}
W3_Library_Init();
struct W3* w3 = W3_Create("http", argv[1], 80);
- W3_Set_Method(w3, "GET");
- W3_Set_Path(w3, argv[2]);
- W3_Send_Request(w3);
- W3_Free(w3);
+ if(w3 != NULL){
+ W3_Set_Method(w3, "GET");
+ W3_Set_Path(w3, argv[2]);
+ W3_Send_Request(w3);
+ W3_Free(w3);
+ }else{
+ fprintf(stderr, "Failed to fetch\n");
+ return 1;
+ }
+ return 0;
}
&w3->ssl_ctx
#endif
);
+ if(w3->sock == -1){
+ W3_Free(w3);
+ w3 = NULL;
+ }
return w3;
}
sprintf(strport, "%d", port);
s = getaddrinfo(hostname, strport, &hints, &result);
if(s != 0){
+ free(strport);
__W3_Debug("Resolve", "Failed");
return -1; /* Failed to resolve */
}
$(MAKE) -C ./Example CC=$(CC) fetch
./Library/W3Version.h:
- m4 -DSUFFIX=\"/W\" ./W3Version.h.p > $@
+ m4 -DSUFFIX=\"W\" ./W3Version.h.p > $@
else
-cp LICENSE w3-$(VERSION)/
tar czvf w3-$(VERSION).tar.gz w3-$(VERSION)
zip -rv w3-$(VERSION).zip w3-$(VERSION)
+ -/usr/lha/bin/lha a w3-$(VERSION).lzh w3-$(VERSION)
rm -rf w3-$(VERSION)