VLC_EXPORT( ssize_t, net_Printf, ( vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, ... ) LIBVLC_FORMAT( 4, 5 ) );
+#define net_Printf(o,fd,vs,...) net_Printf(VLC_OBJECT(o),fd,vs, __VA_ARGS__)
VLC_EXPORT( ssize_t, net_vaPrintf, ( vlc_object_t *p_this, int fd, const v_socket_t *, const char *psz_fmt, va_list args ) );
#define net_vaPrintf(a,b,c,d,e) net_vaPrintf(VLC_OBJECT(a),b,c,d,e)
msg_Dbg( p_access, "ftp_SendCommand:\"%s\"", psz_cmd);
- if( net_Printf( VLC_OBJECT(p_access), p_sys->fd_cmd, NULL, "%s\r\n",
- psz_cmd ) < 0 )
+ if( net_Printf( p_access, p_sys->fd_cmd, NULL, "%s\r\n", psz_cmd ) < 0 )
{
msg_Err( p_access, "failed to send command" );
return VLC_EGENERIC;
return -1;
}
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
+ net_Printf( p_access, p_sys->fd, NULL,
"CONNECT %s:%d HTTP/1.%d\r\nHost: %s:%d\r\n\r\n",
p_sys->url.psz_host, p_sys->url.i_port,
p_sys->i_version,
{
if( p_sys->url.psz_path )
{
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
+ net_Printf( p_access, p_sys->fd, NULL,
"GET http://%s:%d%s HTTP/1.%d\r\n",
p_sys->url.psz_host, p_sys->url.i_port,
p_sys->url.psz_path, p_sys->i_version );
}
else
{
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
+ net_Printf( p_access, p_sys->fd, NULL,
"GET http://%s:%d/ HTTP/1.%d\r\n",
p_sys->url.psz_host, p_sys->url.i_port,
p_sys->i_version );
}
if( p_sys->url.i_port != (pvs ? 443 : 80) )
{
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, pvs,
+ net_Printf( p_access, p_sys->fd, pvs,
"GET %s HTTP/1.%d\r\nHost: %s:%d\r\n",
psz_path, p_sys->i_version, p_sys->url.psz_host,
p_sys->url.i_port );
}
else
{
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, pvs,
+ net_Printf( p_access, p_sys->fd, pvs,
"GET %s HTTP/1.%d\r\nHost: %s\r\n",
psz_path, p_sys->i_version, p_sys->url.psz_host );
}
}
/* User Agent */
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, pvs, "User-Agent: %s\r\n",
+ net_Printf( p_access, p_sys->fd, pvs, "User-Agent: %s\r\n",
p_sys->psz_user_agent );
/* Offset */
if( p_sys->i_version == 1 && ! p_sys->b_continuous )
{
p_sys->b_persist = true;
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, pvs,
+ net_Printf( p_access, p_sys->fd, pvs,
"Range: bytes=%"PRIu64"-\r\n", i_tell );
}
if( is_in_right_domain )
{
msg_Dbg( p_access, "Sending Cookie %s", psz_cookie_content );
- if( net_Printf( VLC_OBJECT(p_access), p_sys->fd, pvs, "Cookie: %s\r\n", psz_cookie_content ) < 0 )
+ if( net_Printf( p_access, p_sys->fd, pvs, "Cookie: %s\r\n", psz_cookie_content ) < 0 )
msg_Err( p_access, "failed to send Cookie" );
}
free( psz_cookie_content );
AuthReply( p_access, "Proxy-", &p_sys->proxy, &p_sys->proxy_auth );
/* ICY meta data request */
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, pvs, "Icy-MetaData: 1\r\n" );
+ net_Printf( p_access, p_sys->fd, pvs, "Icy-MetaData: 1\r\n" );
- if( net_Printf( VLC_OBJECT(p_access), p_sys->fd, pvs, "\r\n" ) < 0 )
+ if( net_Printf( p_access, p_sys->fd, pvs, "\r\n" ) < 0 )
{
msg_Err( p_access, "failed to send request" );
Disconnect( p_access );
if ( psz_value == NULL )
return;
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, p_sys->p_vs,
+ net_Printf( p_access, p_sys->fd, p_sys->p_vs,
"%sAuthorization: %s\r\n", psz_prefix, psz_value );
free( psz_value );
}
if( p_sys->b_proxy )
{
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
+ net_Printf( p_access, p_sys->fd, NULL,
"GET http://%s:%d%s HTTP/1.0\r\n",
p_sys->url.psz_host, p_sys->url.i_port,
( (p_sys->url.psz_path == NULL) ||
b64 = vlc_b64_encode( buf );
free( buf );
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
+ net_Printf( p_access, p_sys->fd, NULL,
"Proxy-Authorization: Basic %s\r\n", b64 );
free( b64 );
}
}
else
{
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
+ net_Printf( p_access, p_sys->fd, NULL,
"GET %s HTTP/1.0\r\n"
"Host: %s:%d\r\n",
( (p_sys->url.psz_path == NULL) ||
if( OpenConnection( p_access ) )
return VLC_EGENERIC;
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
+ net_Printf( p_access, p_sys->fd, NULL,
"Accept: */*\r\n"
"User-Agent: "MMSH_USER_AGENT"\r\n"
"Pragma: no-cache,rate=1.000000,stream-time=0,stream-offset=0:0,request-context=%d,max-duration=0\r\n"
p_sys->i_request_context++,
GUID_PRINT( p_sys->guid ) );
- if( net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL, "\r\n" ) < 0 )
+ if( net_Printf( p_access, p_sys->fd, NULL, "\r\n" ) < 0 )
{
msg_Err( p_access, "failed to send request" );
goto error;
if( OpenConnection( p_access ) )
return VLC_EGENERIC;
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
+ net_Printf( p_access, p_sys->fd, NULL,
"Accept: */*\r\n"
"User-Agent: "MMSH_USER_AGENT"\r\n" );
if( p_sys->b_broadcast )
{
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
+ net_Printf( p_access, p_sys->fd, NULL,
"Pragma: no-cache,rate=1.000000,request-context=%d\r\n",
p_sys->i_request_context++ );
}
else
{
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
+ net_Printf( p_access, p_sys->fd, NULL,
"Pragma: no-cache,rate=1.000000,stream-time=0,stream-offset=%u:%u,request-context=%d,max-duration=0\r\n",
(uint32_t)((i_pos >> 32)&0xffffffff),
(uint32_t)(i_pos&0xffffffff),
p_sys->i_request_context++ );
}
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
+ net_Printf( p_access, p_sys->fd, NULL,
"Pragma: xPlayStrm=1\r\n"
"Pragma: xClientGUID={"GUID_FMT"}\r\n"
"Pragma: stream-switch-count=%d\r\n"
{
i_select = 0;
}
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
+ net_Printf( p_access, p_sys->fd, NULL,
"ffff:%d:%d ", i, i_select );
}
}
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL, "\r\n" );
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
+ net_Printf( p_access, p_sys->fd, NULL, "\r\n" );
+ net_Printf( p_access, p_sys->fd, NULL,
"Connection: Close\r\n" );
- if( net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL, "\r\n" ) < 0 )
+ if( net_Printf( p_access, p_sys->fd, NULL, "\r\n" ) < 0 )
{
msg_Err( p_access, "failed to send request" );
return VLC_EGENERIC;
//fprintf(stderr, "Write: %s", p_buffer);
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, 0, "%s", p_buffer );
+ net_Printf( p_access, p_sys->fd, 0, "%s", p_buffer );
return 0;
}
/* we transmit the data */
i_net_ret = net_Printf(
- VLC_OBJECT( p_intf ), i_post_socket, NULL,
+ p_intf, i_post_socket, NULL,
POST_REQUEST, p_sys->psz_submit_file,
(unsigned)strlen( psz_submit ), p_sys->psz_submit_host,
VERSION, psz_submit
return psz_line;
}
+#undef net_Printf
ssize_t net_Printf( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
const char *psz_fmt, ... )
{