diff options
author | Amar Takhar <mplayer@darkbeer.org> | 2009-07-07 01:15:02 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-07-07 01:38:20 +0300 |
commit | e306174952d42e1cd6cc5efc50ae6bb0410501bc (patch) | |
tree | a7eb451f2c634f17d8e36a72b6305c1aff508904 /stream/network.c | |
parent | b5972d6f14c04384d88d3f813b435d484562403f (diff) | |
download | mpv-e306174952d42e1cd6cc5efc50ae6bb0410501bc.tar.bz2 mpv-e306174952d42e1cd6cc5efc50ae6bb0410501bc.tar.xz |
Translation system changes part 2: replace macros by strings
Replace all MSGTR_ macros in the source by the corresponding English
string.
Diffstat (limited to 'stream/network.c')
-rw-r--r-- | stream/network.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/stream/network.c b/stream/network.c index c5b31a1b12..682bbf53d4 100644 --- a/stream/network.c +++ b/stream/network.c @@ -98,7 +98,7 @@ streaming_ctrl_new(void) { streaming_ctrl_t *streaming_ctrl; streaming_ctrl = malloc(sizeof(streaming_ctrl_t)); if( streaming_ctrl==NULL ) { - mp_tmsg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed); + mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n"); return NULL; } memset( streaming_ctrl, 0, sizeof(streaming_ctrl_t) ); @@ -136,14 +136,14 @@ check4proxies( URL_t *url ) { if( proxy_url==NULL ) { mp_tmsg(MSGT_NETWORK,MSGL_WARN, - MSGTR_MPDEMUX_NW_InvalidProxySettingTryingWithout); + "Invalid proxy setting... Trying without proxy.\n"); return url_out; } #ifdef HAVE_AF_INET6 if (network_ipv4_only_proxy && (gethostbyname(url->hostname)==NULL)) { mp_tmsg(MSGT_NETWORK,MSGL_WARN, - MSGTR_MPDEMUX_NW_CantResolvTryingWithoutProxy); + "Could not resolve remote hostname for AF_INET. Trying without proxy.\n"); url_free(proxy_url); return url_out; } @@ -153,7 +153,7 @@ check4proxies( URL_t *url ) { len = strlen( proxy_url->hostname ) + strlen( url->url ) + 20; // 20 = http_proxy:// + port new_url = malloc( len+1 ); if( new_url==NULL ) { - mp_tmsg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed); + mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n"); url_free(proxy_url); return url_out; } @@ -238,7 +238,7 @@ http_send_request( URL_t *url, off_t pos ) { ret = send( fd, http_hdr->buffer, http_hdr->buffer_size, 0 ); if( ret!=(int)http_hdr->buffer_size ) { - mp_tmsg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ErrSendingHTTPRequest); + mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Error while sending HTTP request: Didn't send all the request.\n"); goto err_out; } @@ -267,12 +267,12 @@ http_read_response( int fd ) { do { i = recv( fd, response, BUFFER_SIZE, 0 ); if( i<0 ) { - mp_tmsg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ReadFailed); + mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Read failed.\n"); http_free( http_hdr ); return NULL; } if( i==0 ) { - mp_tmsg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_Read0CouldBeEOF); + mp_tmsg(MSGT_NETWORK,MSGL_ERR,"http_read_response read 0 (i.e. EOF).\n"); http_free( http_hdr ); return NULL; } @@ -286,8 +286,14 @@ int http_authenticate(HTTP_header_t *http_hdr, URL_t *url, int *auth_retry) { char *aut; +#define MPDEMUX_NW_AuthFailed _(\ +"Authentication failed. Please use the -user and -passwd options to provide your\n"\ +"username/password for a list of URLs, or form an URL like:\n"\ +"http://username:password@hostname/file\n") + + if( *auth_retry==1 ) { - mp_tmsg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_AuthFailed); + mp_tmsg(MSGT_NETWORK,MSGL_ERR,MPDEMUX_NW_AuthFailed); return -1; } if( *auth_retry>0 ) { @@ -306,28 +312,28 @@ http_authenticate(HTTP_header_t *http_hdr, URL_t *url, int *auth_retry) { char *aut_space; aut_space = strstr(aut, "realm="); if( aut_space!=NULL ) aut_space += 6; - mp_tmsg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_NW_AuthRequiredFor, aut_space); + mp_tmsg(MSGT_NETWORK,MSGL_INFO,"Authentication required for %s\n", aut_space); } else { - mp_tmsg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_NW_AuthRequired); + mp_tmsg(MSGT_NETWORK,MSGL_INFO,"Authentication required.\n"); } if( network_username ) { url->username = strdup(network_username); if( url->username==NULL ) { - mp_tmsg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed); + mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n"); return -1; } } else { - mp_tmsg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_AuthFailed); + mp_tmsg(MSGT_NETWORK,MSGL_ERR,MPDEMUX_NW_AuthFailed); return -1; } if( network_password ) { url->password = strdup(network_password); if( url->password==NULL ) { - mp_tmsg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed); + mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n"); return -1; } } else { - mp_tmsg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_NW_NoPasswdProvidedTryingBlank); + mp_tmsg(MSGT_NETWORK,MSGL_INFO,"No password provided, trying blank password.\n"); } (*auth_retry)++; return 0; @@ -360,7 +366,7 @@ http_seek( stream_t *stream, off_t pos ) { } break; default: - mp_tmsg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_NW_ErrServerReturned, http_hdr->status_code, http_hdr->reason_phrase ); + mp_tmsg(MSGT_NETWORK,MSGL_ERR,"Server returns %d: %s\n", http_hdr->status_code, http_hdr->reason_phrase ); close( fd ); fd = -1; } @@ -382,7 +388,7 @@ streaming_bufferize( streaming_ctrl_t *streaming_ctrl, char *buffer, int size) { //printf("streaming_bufferize\n"); streaming_ctrl->buffer = malloc(size); if( streaming_ctrl->buffer==NULL ) { - mp_tmsg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed); + mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n"); return -1; } memcpy( streaming_ctrl->buffer, buffer, size ); @@ -442,7 +448,7 @@ void fixup_network_stream_cache(stream_t *stream) { stream_cache_size = (stream->streaming_ctrl->prebuffer_size/1024)*5; if( stream_cache_size<64 ) stream_cache_size = 64; // 16KBytes min buffer } - mp_tmsg(MSGT_NETWORK,MSGL_INFO,MSGTR_MPDEMUX_NW_CacheSizeSetTo, stream_cache_size); + mp_tmsg(MSGT_NETWORK,MSGL_INFO,"Cache size set to %d KBytes\n", stream_cache_size); } } |