summaryrefslogtreecommitdiffstats
path: root/stream/url.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/url.c')
-rw-r--r--stream/url.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/stream/url.c b/stream/url.c
index 62e3bdcf2a..8d0176e45f 100644
--- a/stream/url.c
+++ b/stream/url.c
@@ -28,7 +28,6 @@
#include "url.h"
#include "mp_msg.h"
-#include "help_mp.h"
#ifndef SIZE_MAX
#define SIZE_MAX ((size_t)-1)
@@ -69,19 +68,19 @@ url_new(const char* url) {
if( url==NULL ) return NULL;
if (strlen(url) > (SIZE_MAX / 3 - 1)) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
escfilename=malloc(strlen(url)*3+1);
if (!escfilename ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
// Create the URL container
Curl = malloc(sizeof(URL_t));
if( Curl==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
@@ -93,7 +92,7 @@ url_new(const char* url) {
// Copy the url in the URL container
Curl->url = strdup(escfilename);
if( Curl->url==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
mp_msg(MSGT_OPEN,MSGL_V,"Filename for url is now %s\n",escfilename);
@@ -113,7 +112,7 @@ url_new(const char* url) {
pos1 = ptr1-escfilename;
Curl->protocol = malloc(pos1+1);
if( Curl->protocol==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
strncpy(Curl->protocol, escfilename, pos1);
@@ -135,7 +134,7 @@ url_new(const char* url) {
int len = ptr2-ptr1;
Curl->username = malloc(len+1);
if( Curl->username==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
strncpy(Curl->username, ptr1, len);
@@ -148,7 +147,7 @@ url_new(const char* url) {
Curl->username[ptr3-ptr1]='\0';
Curl->password = malloc(len2+1);
if( Curl->password==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
strncpy( Curl->password, ptr3+1, len2);
@@ -200,7 +199,7 @@ url_new(const char* url) {
// copy the hostname in the URL container
Curl->hostname = malloc(pos2-pos1+1);
if( Curl->hostname==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
strncpy(Curl->hostname, ptr1, pos2-pos1);
@@ -215,7 +214,7 @@ url_new(const char* url) {
// copy the path/filename in the URL container
Curl->file = strdup(ptr2);
if( Curl->file==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
}
@@ -224,7 +223,7 @@ url_new(const char* url) {
if( Curl->file==NULL ) {
Curl->file = malloc(2);
if( Curl->file==NULL ) {
- mp_msg(MSGT_NETWORK,MSGL_FATAL,MSGTR_MemAllocFailed);
+ mp_tmsg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed.\n");
goto err_out;
}
strcpy(Curl->file, "/");
@@ -302,7 +301,7 @@ url_escape_string_part(char *outbuf, const char *inbuf) {
*outbuf++=c; // already
// dont escape again
- mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_URL_StringAlreadyEscaped,c,c1,c2);
+ mp_tmsg(MSGT_NETWORK,MSGL_ERR,"String appears to be already escaped in url_escape %c%c1%c2\n",c,c1,c2);
// error as this should not happen against RFC 2396
// to escape a string twice
} else {