]> Nishi Git Mirror - libw3.git/commitdiff
added non-supported protocol error
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Wed, 24 Jan 2024 13:39:50 +0000 (13:39 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Wed, 24 Jan 2024 13:39:50 +0000 (13:39 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@59 d27a3e52-49c5-7645-884c-6793ebffc270

Example/fetch.c
Library/Core.c
W3Version.h.p

index 2d0d4c7aed7cc467b1cc54b31a0822c83b4d8109..8b58f8c6e102009874d97a0cba04ea8bff679584 100644 (file)
@@ -37,7 +37,7 @@ int main(int argc, char** argv) {
                return 1;
        }
        W3_Library_Init();
-       struct W3* w3 = W3_Create("https", argv[1], 443);
+       struct W3* w3 = W3_Create("http", argv[1], 80);
        if(w3 != NULL) {
                W3_Set_Read_Size(w3, 1024);
                W3_Set_Method(w3, argv[3] == NULL ? "GET" : argv[3]);
index 527ac62def5a38d5fd02b0a4a7e60e2c93bc3453..7bb77a8969b99186d87ec508bb13ad57fa122e16 100644 (file)
@@ -63,6 +63,16 @@ struct W3* W3_Create(const char* protocol, const char* hostname, int port) {
        w3->ssl_ctx = NULL;
 #endif
        if(strcmp(protocol, "file") != 0) {
+               if(strcmp(protocol, "http") == 0){
+#ifdef SSL_SUPPORT
+               }else if(strcmp(protocol, "https") == 0){
+#endif
+               }else{
+                       __W3_Debug("Protocol", "Not suppported");
+                       W3_Free(w3);
+                       w3 = NULL;
+                       return w3;
+               }
                w3->hostname = __W3_Strdup(hostname);
                if(ssl) __W3_Debug("Protocol", "Enabled SSL");
                w3->sock = __W3_DNS_Connect(hostname, ssl, port
index 1146e87f38b58b525fdb2b87a16bfe326d9e26f3..180169a4ee3569a48c5c98a977d0d5c2ef6c7331 100644 (file)
@@ -6,7 +6,7 @@
 extern "C" {
 #endif
 
-#define LIBW3_VERSION "1.3" \
+#define LIBW3_VERSION "1.3A" \
 SUFFIX
 
 #ifdef __cplusplus