2 files changed, 6 insertions(+), 7 deletions(-)
M castor.c
M url.c
M castor.c => castor.c +4 -4
@@ 409,7 409,6 @@ gemini_get(Url *url)
}
Bflush(&body);
- close(fd);
h->p = hist;
h->n = nil;
@@ 417,14 416,14 @@ gemini_get(Url *url)
hist = h;
show(c);
- }
+ }
break;
case 30:
- gemini_get(urlparse(nil, r->meta));
+ gemini_get(urlparse(url, r->meta));
break;
case 31:
- gemini_get(urlparse(nil, r->meta));
+ gemini_get(urlparse(url, r->meta));
break;
case 40:
message("Temporary failure, please try again later!");
@@ 469,6 468,7 @@ gemini_get(Url *url)
// message("Unknown status code %d!", status);
// break;
}
+ close(fd);
}
void
M url.c => url.c +2 -3
@@ 223,13 223,12 @@ mklowcase(char *s)
static Url *
saneurl(Url *u)
{
- if(strcmp(u->scheme, "mailto") == 0 && Upath(u) != nil)
- return u;
-
if(u == nil || u->scheme == nil || u->host == nil || Upath(u) == nil){
freeurl(u);
return nil;
}
+ if(strcmp(u->scheme, "mailto") == 0 && Upath(u) != nil)
+ return u;
if(u->port){
/* remove default ports */
switch(atoi(u->port)){