Permalink
Browse files

bad url bug

  • Loading branch information...
dm
dm committed Sep 28, 2006
1 parent 1c7c222 commit 2ed01ca9f5ceb9d0f2a5e04c3383684c6576ff73
Showing with 21 additions and 18 deletions.
  1. +2 −0 README.modDinoex
  2. +1 −0 THANKS
  3. +6 −6 src/dinoex_admin.c
  4. +6 −6 src/dinoex_misc.c
  5. +6 −6 src/iroffer_dinoex.c
View
@@ -27,6 +27,8 @@ bugfix: MULITNET
bugfix: MULTINET (reported by TheDeath)
rare crash when first net is not connected
+bugfix: FETCH (reported by TheDeath)
+ crashes with bad urls
With Version mod 1.31:
----------------------
View
1 THANKS
@@ -60,6 +60,7 @@ TheDeath
admin command "FETCH"
option "uploadminspace"
reporting not connected bug
+ reporting bad url bug
[GFE]Lunix
alias xdcc list group <group>
View
@@ -1434,6 +1434,7 @@ void fetch_multi_fdset(fd_set *read_fd_set, fd_set *write_fd_set, fd_set *exc_fd
static fetch_curl_t *clean_fetch(fetch_curl_t *ft);
static fetch_curl_t *clean_fetch(fetch_curl_t *ft)
{
+ updatecontext();
fclose(ft->writefd);
mydelete(ft->errorbuf);
mydelete(ft->name);
@@ -1493,6 +1494,7 @@ void fetch_perform(void)
{
a_respond(&(ft->u),"fetch %s completed", ft->name);
}
+ updatecontext();
curl_easy_cleanup(ft->curlhandle);
seen ++;
fetch_started --;
@@ -1502,6 +1504,7 @@ void fetch_perform(void)
ft = irlist_get_next(ft);
}
} while (msgs_in_queue > 0);
+ updatecontext();
if (seen == 0)
outerror(OUTERROR_TYPE_WARN_LOUD,"curlhandle not found ");
#ifdef MULTINET
@@ -1530,7 +1533,7 @@ void start_fetch_url(const userinput *const u)
fullfile = mymalloc(strlen(gdata.uploaddir) + strlen(name) + 2);
sprintf(fullfile, "%s/%s", gdata.uploaddir, name);
writefd = fopen(fullfile, "w+");
- if ((writefd < 0) && (errno == EEXIST))
+ if ((writefd == NULL) && (errno == EEXIST))
{
retval = stat(fullfile, &s);
if (retval < 0)
@@ -1541,13 +1544,10 @@ void start_fetch_url(const userinput *const u)
mydelete(fullfile);
return;
}
+ resumesize = s.st_size;
writefd = fopen(fullfile, "a");
- if (writefd >= 0)
- {
- resumesize = s.st_size;
- }
}
- if (writefd < 0)
+ if (writefd == NULL)
{
outerror(OUTERROR_TYPE_WARN_LOUD,"Cant Access Upload File '%s': %s",
fullfile,strerror(errno));
View
@@ -1434,6 +1434,7 @@ void fetch_multi_fdset(fd_set *read_fd_set, fd_set *write_fd_set, fd_set *exc_fd
static fetch_curl_t *clean_fetch(fetch_curl_t *ft);
static fetch_curl_t *clean_fetch(fetch_curl_t *ft)
{
+ updatecontext();
fclose(ft->writefd);
mydelete(ft->errorbuf);
mydelete(ft->name);
@@ -1493,6 +1494,7 @@ void fetch_perform(void)
{
a_respond(&(ft->u),"fetch %s completed", ft->name);
}
+ updatecontext();
curl_easy_cleanup(ft->curlhandle);
seen ++;
fetch_started --;
@@ -1502,6 +1504,7 @@ void fetch_perform(void)
ft = irlist_get_next(ft);
}
} while (msgs_in_queue > 0);
+ updatecontext();
if (seen == 0)
outerror(OUTERROR_TYPE_WARN_LOUD,"curlhandle not found ");
#ifdef MULTINET
@@ -1530,7 +1533,7 @@ void start_fetch_url(const userinput *const u)
fullfile = mymalloc(strlen(gdata.uploaddir) + strlen(name) + 2);
sprintf(fullfile, "%s/%s", gdata.uploaddir, name);
writefd = fopen(fullfile, "w+");
- if ((writefd < 0) && (errno == EEXIST))
+ if ((writefd == NULL) && (errno == EEXIST))
{
retval = stat(fullfile, &s);
if (retval < 0)
@@ -1541,13 +1544,10 @@ void start_fetch_url(const userinput *const u)
mydelete(fullfile);
return;
}
+ resumesize = s.st_size;
writefd = fopen(fullfile, "a");
- if (writefd >= 0)
- {
- resumesize = s.st_size;
- }
}
- if (writefd < 0)
+ if (writefd == NULL)
{
outerror(OUTERROR_TYPE_WARN_LOUD,"Cant Access Upload File '%s': %s",
fullfile,strerror(errno));
View
@@ -1434,6 +1434,7 @@ void fetch_multi_fdset(fd_set *read_fd_set, fd_set *write_fd_set, fd_set *exc_fd
static fetch_curl_t *clean_fetch(fetch_curl_t *ft);
static fetch_curl_t *clean_fetch(fetch_curl_t *ft)
{
+ updatecontext();
fclose(ft->writefd);
mydelete(ft->errorbuf);
mydelete(ft->name);
@@ -1493,6 +1494,7 @@ void fetch_perform(void)
{
a_respond(&(ft->u),"fetch %s completed", ft->name);
}
+ updatecontext();
curl_easy_cleanup(ft->curlhandle);
seen ++;
fetch_started --;
@@ -1502,6 +1504,7 @@ void fetch_perform(void)
ft = irlist_get_next(ft);
}
} while (msgs_in_queue > 0);
+ updatecontext();
if (seen == 0)
outerror(OUTERROR_TYPE_WARN_LOUD,"curlhandle not found ");
#ifdef MULTINET
@@ -1530,7 +1533,7 @@ void start_fetch_url(const userinput *const u)
fullfile = mymalloc(strlen(gdata.uploaddir) + strlen(name) + 2);
sprintf(fullfile, "%s/%s", gdata.uploaddir, name);
writefd = fopen(fullfile, "w+");
- if ((writefd < 0) && (errno == EEXIST))
+ if ((writefd == NULL) && (errno == EEXIST))
{
retval = stat(fullfile, &s);
if (retval < 0)
@@ -1541,13 +1544,10 @@ void start_fetch_url(const userinput *const u)
mydelete(fullfile);
return;
}
+ resumesize = s.st_size;
writefd = fopen(fullfile, "a");
- if (writefd >= 0)
- {
- resumesize = s.st_size;
- }
}
- if (writefd < 0)
+ if (writefd == NULL)
{
outerror(OUTERROR_TYPE_WARN_LOUD,"Cant Access Upload File '%s': %s",
fullfile,strerror(errno));

0 comments on commit 2ed01ca

Please sign in to comment.