Fossil SCM
Refactoring, phase 1, move httpCmd.
Commit
d1b4d1b6304ab4a6edc73c79fc734d0787fc56f3
Parent
aeedba68b656feb…
2 files changed
+90
-90
+90
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -828,10 +828,99 @@ | ||
| 828 | 828 | rc = TH_ERROR; |
| 829 | 829 | } |
| 830 | 830 | re_free(pRe); |
| 831 | 831 | return rc; |
| 832 | 832 | } |
| 833 | + | |
| 834 | +/* | |
| 835 | +** TH command: http -async URL ?PAYLOAD? | |
| 836 | +** | |
| 837 | +** Do a HTTP request to specified URL. If PAYLOAD is present | |
| 838 | +** it will be POST'ed as text/plain, otherwise it's a GET | |
| 839 | +*/ | |
| 840 | +static int httpCmd( | |
| 841 | + Th_Interp *interp, | |
| 842 | + void *p, | |
| 843 | + int argc, | |
| 844 | + const char **argv, | |
| 845 | + int *argl | |
| 846 | +){ | |
| 847 | + int i; | |
| 848 | + const char *zSep, *type, *regexp, *params; | |
| 849 | + Blob hdr, payload; | |
| 850 | + ReCompiled *pRe = 0; | |
| 851 | + | |
| 852 | + if( (argc>1) && strcmp(argv[1],"-async") ){ | |
| 853 | + Th_ErrorMessage(interp, "synchronous http requests not yet implemented", 0, 0); | |
| 854 | + return TH_ERROR; | |
| 855 | + } | |
| 856 | + ++argv; | |
| 857 | + --argc; | |
| 858 | + blob_zero(&payload); | |
| 859 | + if( argc!=2 ){ | |
| 860 | + if( argc != 3 ){ | |
| 861 | + return Th_WrongNumArgs(interp, "http -async url ?payload?"); | |
| 862 | + } | |
| 863 | + blob_append(&payload, argv[2], -1); | |
| 864 | + type = "POST"; | |
| 865 | + }else{ | |
| 866 | + type = "GET"; | |
| 867 | + } | |
| 868 | + params = strrchr(argv[1], '?'); | |
| 869 | + url_parse(argv[1], 0); | |
| 870 | + if( g.urlIsSsh || g.urlIsFile ){ | |
| 871 | + Th_ErrorMessage(interp, "url must be http:// or https://", 0, 0); | |
| 872 | + return TH_ERROR; | |
| 873 | + } | |
| 874 | + regexp = db_get("th1-uri-regexp", 0); | |
| 875 | + if( regexp && regexp[0] ){ | |
| 876 | + const char * zErr = re_compile(&pRe, regexp, 0); | |
| 877 | + if( zErr ){ | |
| 878 | + Th_SetResult(interp, zErr, -1); | |
| 879 | + return TH_ERROR; | |
| 880 | + } | |
| 881 | + } | |
| 882 | + if (!pRe || !re_match(pRe, (const unsigned char *)argv[1], -1) ){ | |
| 883 | + Th_SetResult(interp, "url not allowed", -1); | |
| 884 | + return TH_ERROR; | |
| 885 | + } | |
| 886 | + re_free(pRe); | |
| 887 | + if( transport_open() ){ | |
| 888 | + Th_ErrorMessage(interp, transport_errmsg(), 0, 0); | |
| 889 | + return TH_ERROR; | |
| 890 | + } | |
| 891 | + blob_zero(&hdr); | |
| 892 | + i = strlen(g.urlPath); | |
| 893 | + if( (i>0) && (params!=argv[1]) ){ | |
| 894 | + zSep = ""; | |
| 895 | + }else{ | |
| 896 | + zSep = "/"; | |
| 897 | + } | |
| 898 | + blob_appendf(&hdr, "%s %s%s%s HTTP/1.0\r\n", type, zSep, g.urlPath, params?params:""); | |
| 899 | + if( g.urlProxyAuth ){ | |
| 900 | + blob_appendf(&hdr, "Proxy-Authorization: %s\r\n", g.urlProxyAuth); | |
| 901 | + } | |
| 902 | + if( g.urlPasswd && g.urlUser && g.urlPasswd[0]=='#' ){ | |
| 903 | + char *zCredentials = mprintf("%s:%s", g.urlUser, &g.urlPasswd[1]); | |
| 904 | + char *zEncoded = encode64(zCredentials, -1); | |
| 905 | + blob_appendf(&hdr, "Authorization: Basic %s\r\n", zEncoded); | |
| 906 | + fossil_free(zEncoded); | |
| 907 | + fossil_free(zCredentials); | |
| 908 | + } | |
| 909 | + blob_appendf(&hdr, "Host: %s\r\n", g.urlHostname); | |
| 910 | + blob_appendf(&hdr, "User-Agent: Fossil/" RELEASE_VERSION | |
| 911 | + " (" MANIFEST_DATE " " MANIFEST_VERSION ")\r\n"); | |
| 912 | + blob_appendf(&hdr, "Content-Type: text/plain\r\n"); | |
| 913 | + blob_appendf(&hdr, "Content-Length: %d\r\n\r\n", blob_size(&payload)); | |
| 914 | + | |
| 915 | + transport_send(&hdr); | |
| 916 | + transport_send(&payload); | |
| 917 | + transport_close(); | |
| 918 | + g.urlProtocol=0; /* Make sure the url is not re-used. */ | |
| 919 | + Th_SetResult(interp, "", -1); | |
| 920 | + return TH_OK; | |
| 921 | +} | |
| 833 | 922 | |
| 834 | 923 | /* |
| 835 | 924 | ** Make sure the interpreter has been initialized. Initialize it if |
| 836 | 925 | ** it has not been already. |
| 837 | 926 | ** |
| @@ -856,10 +945,11 @@ | ||
| 856 | 945 | {"enable_output", enableOutputCmd, 0}, |
| 857 | 946 | {"hascap", hascapCmd, 0}, |
| 858 | 947 | {"hasfeature", hasfeatureCmd, 0}, |
| 859 | 948 | {"html", putsCmd, (void*)&aFlags[0]}, |
| 860 | 949 | {"htmlize", htmlizeCmd, 0}, |
| 950 | + {"http", httpCmd, 0}, | |
| 861 | 951 | {"linecount", linecntCmd, 0}, |
| 862 | 952 | {"puts", putsCmd, (void*)&aFlags[1]}, |
| 863 | 953 | {"query", queryCmd, 0}, |
| 864 | 954 | {"randhex", randhexCmd, 0}, |
| 865 | 955 | {"regexp", regexpCmd, 0}, |
| 866 | 956 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -828,10 +828,99 @@ | |
| 828 | rc = TH_ERROR; |
| 829 | } |
| 830 | re_free(pRe); |
| 831 | return rc; |
| 832 | } |
| 833 | |
| 834 | /* |
| 835 | ** Make sure the interpreter has been initialized. Initialize it if |
| 836 | ** it has not been already. |
| 837 | ** |
| @@ -856,10 +945,11 @@ | |
| 856 | {"enable_output", enableOutputCmd, 0}, |
| 857 | {"hascap", hascapCmd, 0}, |
| 858 | {"hasfeature", hasfeatureCmd, 0}, |
| 859 | {"html", putsCmd, (void*)&aFlags[0]}, |
| 860 | {"htmlize", htmlizeCmd, 0}, |
| 861 | {"linecount", linecntCmd, 0}, |
| 862 | {"puts", putsCmd, (void*)&aFlags[1]}, |
| 863 | {"query", queryCmd, 0}, |
| 864 | {"randhex", randhexCmd, 0}, |
| 865 | {"regexp", regexpCmd, 0}, |
| 866 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -828,10 +828,99 @@ | |
| 828 | rc = TH_ERROR; |
| 829 | } |
| 830 | re_free(pRe); |
| 831 | return rc; |
| 832 | } |
| 833 | |
| 834 | /* |
| 835 | ** TH command: http -async URL ?PAYLOAD? |
| 836 | ** |
| 837 | ** Do a HTTP request to specified URL. If PAYLOAD is present |
| 838 | ** it will be POST'ed as text/plain, otherwise it's a GET |
| 839 | */ |
| 840 | static int httpCmd( |
| 841 | Th_Interp *interp, |
| 842 | void *p, |
| 843 | int argc, |
| 844 | const char **argv, |
| 845 | int *argl |
| 846 | ){ |
| 847 | int i; |
| 848 | const char *zSep, *type, *regexp, *params; |
| 849 | Blob hdr, payload; |
| 850 | ReCompiled *pRe = 0; |
| 851 | |
| 852 | if( (argc>1) && strcmp(argv[1],"-async") ){ |
| 853 | Th_ErrorMessage(interp, "synchronous http requests not yet implemented", 0, 0); |
| 854 | return TH_ERROR; |
| 855 | } |
| 856 | ++argv; |
| 857 | --argc; |
| 858 | blob_zero(&payload); |
| 859 | if( argc!=2 ){ |
| 860 | if( argc != 3 ){ |
| 861 | return Th_WrongNumArgs(interp, "http -async url ?payload?"); |
| 862 | } |
| 863 | blob_append(&payload, argv[2], -1); |
| 864 | type = "POST"; |
| 865 | }else{ |
| 866 | type = "GET"; |
| 867 | } |
| 868 | params = strrchr(argv[1], '?'); |
| 869 | url_parse(argv[1], 0); |
| 870 | if( g.urlIsSsh || g.urlIsFile ){ |
| 871 | Th_ErrorMessage(interp, "url must be http:// or https://", 0, 0); |
| 872 | return TH_ERROR; |
| 873 | } |
| 874 | regexp = db_get("th1-uri-regexp", 0); |
| 875 | if( regexp && regexp[0] ){ |
| 876 | const char * zErr = re_compile(&pRe, regexp, 0); |
| 877 | if( zErr ){ |
| 878 | Th_SetResult(interp, zErr, -1); |
| 879 | return TH_ERROR; |
| 880 | } |
| 881 | } |
| 882 | if (!pRe || !re_match(pRe, (const unsigned char *)argv[1], -1) ){ |
| 883 | Th_SetResult(interp, "url not allowed", -1); |
| 884 | return TH_ERROR; |
| 885 | } |
| 886 | re_free(pRe); |
| 887 | if( transport_open() ){ |
| 888 | Th_ErrorMessage(interp, transport_errmsg(), 0, 0); |
| 889 | return TH_ERROR; |
| 890 | } |
| 891 | blob_zero(&hdr); |
| 892 | i = strlen(g.urlPath); |
| 893 | if( (i>0) && (params!=argv[1]) ){ |
| 894 | zSep = ""; |
| 895 | }else{ |
| 896 | zSep = "/"; |
| 897 | } |
| 898 | blob_appendf(&hdr, "%s %s%s%s HTTP/1.0\r\n", type, zSep, g.urlPath, params?params:""); |
| 899 | if( g.urlProxyAuth ){ |
| 900 | blob_appendf(&hdr, "Proxy-Authorization: %s\r\n", g.urlProxyAuth); |
| 901 | } |
| 902 | if( g.urlPasswd && g.urlUser && g.urlPasswd[0]=='#' ){ |
| 903 | char *zCredentials = mprintf("%s:%s", g.urlUser, &g.urlPasswd[1]); |
| 904 | char *zEncoded = encode64(zCredentials, -1); |
| 905 | blob_appendf(&hdr, "Authorization: Basic %s\r\n", zEncoded); |
| 906 | fossil_free(zEncoded); |
| 907 | fossil_free(zCredentials); |
| 908 | } |
| 909 | blob_appendf(&hdr, "Host: %s\r\n", g.urlHostname); |
| 910 | blob_appendf(&hdr, "User-Agent: Fossil/" RELEASE_VERSION |
| 911 | " (" MANIFEST_DATE " " MANIFEST_VERSION ")\r\n"); |
| 912 | blob_appendf(&hdr, "Content-Type: text/plain\r\n"); |
| 913 | blob_appendf(&hdr, "Content-Length: %d\r\n\r\n", blob_size(&payload)); |
| 914 | |
| 915 | transport_send(&hdr); |
| 916 | transport_send(&payload); |
| 917 | transport_close(); |
| 918 | g.urlProtocol=0; /* Make sure the url is not re-used. */ |
| 919 | Th_SetResult(interp, "", -1); |
| 920 | return TH_OK; |
| 921 | } |
| 922 | |
| 923 | /* |
| 924 | ** Make sure the interpreter has been initialized. Initialize it if |
| 925 | ** it has not been already. |
| 926 | ** |
| @@ -856,10 +945,11 @@ | |
| 945 | {"enable_output", enableOutputCmd, 0}, |
| 946 | {"hascap", hascapCmd, 0}, |
| 947 | {"hasfeature", hasfeatureCmd, 0}, |
| 948 | {"html", putsCmd, (void*)&aFlags[0]}, |
| 949 | {"htmlize", htmlizeCmd, 0}, |
| 950 | {"http", httpCmd, 0}, |
| 951 | {"linecount", linecntCmd, 0}, |
| 952 | {"puts", putsCmd, (void*)&aFlags[1]}, |
| 953 | {"query", queryCmd, 0}, |
| 954 | {"randhex", randhexCmd, 0}, |
| 955 | {"regexp", regexpCmd, 0}, |
| 956 |
-90
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -819,99 +819,10 @@ | ||
| 819 | 819 | */ |
| 820 | 820 | static void server_private_xfer_not_authorized(void){ |
| 821 | 821 | @ error not\sauthorized\sto\ssync\sprivate\scontent |
| 822 | 822 | } |
| 823 | 823 | |
| 824 | -/* | |
| 825 | -** TH command: http -async URL ?PAYLOAD? | |
| 826 | -** | |
| 827 | -** Do a HTTP request to specified URL. If PAYLOAD is present | |
| 828 | -** it will be POST'ed as text/plain, otherwise it's a GET | |
| 829 | -*/ | |
| 830 | -static int httpCmd( | |
| 831 | - Th_Interp *interp, | |
| 832 | - void *p, | |
| 833 | - int argc, | |
| 834 | - const char **argv, | |
| 835 | - int *argl | |
| 836 | -){ | |
| 837 | - int i; | |
| 838 | - const char *zSep, *type, *regexp, *params; | |
| 839 | - Blob hdr, payload; | |
| 840 | - ReCompiled *pRe = 0; | |
| 841 | - | |
| 842 | - if( (argc>1) && strcmp(argv[1],"-async") ){ | |
| 843 | - Th_ErrorMessage(interp, "synchronous http requests not yet implemented", 0, 0); | |
| 844 | - return TH_ERROR; | |
| 845 | - } | |
| 846 | - ++argv; | |
| 847 | - --argc; | |
| 848 | - blob_zero(&payload); | |
| 849 | - if( argc!=2 ){ | |
| 850 | - if( argc != 3 ){ | |
| 851 | - return Th_WrongNumArgs(interp, "http -async url ?payload?"); | |
| 852 | - } | |
| 853 | - blob_append(&payload, argv[2], -1); | |
| 854 | - type = "POST"; | |
| 855 | - }else{ | |
| 856 | - type = "GET"; | |
| 857 | - } | |
| 858 | - params = strrchr(argv[1], '?'); | |
| 859 | - url_parse(argv[1], 0); | |
| 860 | - if( g.urlIsSsh || g.urlIsFile ){ | |
| 861 | - Th_ErrorMessage(interp, "url must be http:// or https://", 0, 0); | |
| 862 | - return TH_ERROR; | |
| 863 | - } | |
| 864 | - regexp = db_get("th1-uri-regexp", 0); | |
| 865 | - if( regexp && regexp[0] ){ | |
| 866 | - const char * zErr = re_compile(&pRe, regexp, 0); | |
| 867 | - if( zErr ){ | |
| 868 | - Th_SetResult(interp, zErr, -1); | |
| 869 | - return TH_ERROR; | |
| 870 | - } | |
| 871 | - } | |
| 872 | - if (!pRe || !re_match(pRe, (const unsigned char *)argv[1], -1) ){ | |
| 873 | - Th_SetResult(interp, "url not allowed", -1); | |
| 874 | - return TH_ERROR; | |
| 875 | - } | |
| 876 | - re_free(pRe); | |
| 877 | - if( transport_open() ){ | |
| 878 | - Th_ErrorMessage(interp, transport_errmsg(), 0, 0); | |
| 879 | - return TH_ERROR; | |
| 880 | - } | |
| 881 | - blob_zero(&hdr); | |
| 882 | - i = strlen(g.urlPath); | |
| 883 | - if( (i>0) && (params!=argv[1]) ){ | |
| 884 | - zSep = ""; | |
| 885 | - }else{ | |
| 886 | - zSep = "/"; | |
| 887 | - } | |
| 888 | - blob_appendf(&hdr, "%s %s%s%s HTTP/1.0\r\n", type, zSep, g.urlPath, params?params:""); | |
| 889 | - if( g.urlProxyAuth ){ | |
| 890 | - blob_appendf(&hdr, "Proxy-Authorization: %s\r\n", g.urlProxyAuth); | |
| 891 | - } | |
| 892 | - if( g.urlPasswd && g.urlUser && g.urlPasswd[0]=='#' ){ | |
| 893 | - char *zCredentials = mprintf("%s:%s", g.urlUser, &g.urlPasswd[1]); | |
| 894 | - char *zEncoded = encode64(zCredentials, -1); | |
| 895 | - blob_appendf(&hdr, "Authorization: Basic %s\r\n", zEncoded); | |
| 896 | - fossil_free(zEncoded); | |
| 897 | - fossil_free(zCredentials); | |
| 898 | - } | |
| 899 | - blob_appendf(&hdr, "Host: %s\r\n", g.urlHostname); | |
| 900 | - blob_appendf(&hdr, "User-Agent: Fossil/" RELEASE_VERSION | |
| 901 | - " (" MANIFEST_DATE " " MANIFEST_VERSION ")\r\n"); | |
| 902 | - blob_appendf(&hdr, "Content-Type: text/plain\r\n"); | |
| 903 | - blob_appendf(&hdr, "Content-Length: %d\r\n\r\n", blob_size(&payload)); | |
| 904 | - | |
| 905 | - transport_send(&hdr); | |
| 906 | - transport_send(&payload); | |
| 907 | - transport_close(); | |
| 908 | - g.urlProtocol=0; /* Make sure the url is not re-used. */ | |
| 909 | - Th_SetResult(interp, "", -1); | |
| 910 | - return TH_OK; | |
| 911 | -} | |
| 912 | - | |
| 913 | 824 | static int commonScriptRan = 0; |
| 914 | 825 | |
| 915 | 826 | /* |
| 916 | 827 | ** Run the specified TH1 script, if any, and returns 1 on error. |
| 917 | 828 | */ |
| @@ -944,11 +855,10 @@ | ||
| 944 | 855 | result = run_script("xfer-common-script", 0); |
| 945 | 856 | if( result == TH_ERROR ){ |
| 946 | 857 | /* Error message is left in th interpreter. */ |
| 947 | 858 | commonScriptRan = 2; |
| 948 | 859 | } |
| 949 | - Th_CreateCommand(g.interp, "http", httpCmd, 0, 0); | |
| 950 | 860 | } |
| 951 | 861 | return result; |
| 952 | 862 | } |
| 953 | 863 | |
| 954 | 864 | /* |
| 955 | 865 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -819,99 +819,10 @@ | |
| 819 | */ |
| 820 | static void server_private_xfer_not_authorized(void){ |
| 821 | @ error not\sauthorized\sto\ssync\sprivate\scontent |
| 822 | } |
| 823 | |
| 824 | /* |
| 825 | ** TH command: http -async URL ?PAYLOAD? |
| 826 | ** |
| 827 | ** Do a HTTP request to specified URL. If PAYLOAD is present |
| 828 | ** it will be POST'ed as text/plain, otherwise it's a GET |
| 829 | */ |
| 830 | static int httpCmd( |
| 831 | Th_Interp *interp, |
| 832 | void *p, |
| 833 | int argc, |
| 834 | const char **argv, |
| 835 | int *argl |
| 836 | ){ |
| 837 | int i; |
| 838 | const char *zSep, *type, *regexp, *params; |
| 839 | Blob hdr, payload; |
| 840 | ReCompiled *pRe = 0; |
| 841 | |
| 842 | if( (argc>1) && strcmp(argv[1],"-async") ){ |
| 843 | Th_ErrorMessage(interp, "synchronous http requests not yet implemented", 0, 0); |
| 844 | return TH_ERROR; |
| 845 | } |
| 846 | ++argv; |
| 847 | --argc; |
| 848 | blob_zero(&payload); |
| 849 | if( argc!=2 ){ |
| 850 | if( argc != 3 ){ |
| 851 | return Th_WrongNumArgs(interp, "http -async url ?payload?"); |
| 852 | } |
| 853 | blob_append(&payload, argv[2], -1); |
| 854 | type = "POST"; |
| 855 | }else{ |
| 856 | type = "GET"; |
| 857 | } |
| 858 | params = strrchr(argv[1], '?'); |
| 859 | url_parse(argv[1], 0); |
| 860 | if( g.urlIsSsh || g.urlIsFile ){ |
| 861 | Th_ErrorMessage(interp, "url must be http:// or https://", 0, 0); |
| 862 | return TH_ERROR; |
| 863 | } |
| 864 | regexp = db_get("th1-uri-regexp", 0); |
| 865 | if( regexp && regexp[0] ){ |
| 866 | const char * zErr = re_compile(&pRe, regexp, 0); |
| 867 | if( zErr ){ |
| 868 | Th_SetResult(interp, zErr, -1); |
| 869 | return TH_ERROR; |
| 870 | } |
| 871 | } |
| 872 | if (!pRe || !re_match(pRe, (const unsigned char *)argv[1], -1) ){ |
| 873 | Th_SetResult(interp, "url not allowed", -1); |
| 874 | return TH_ERROR; |
| 875 | } |
| 876 | re_free(pRe); |
| 877 | if( transport_open() ){ |
| 878 | Th_ErrorMessage(interp, transport_errmsg(), 0, 0); |
| 879 | return TH_ERROR; |
| 880 | } |
| 881 | blob_zero(&hdr); |
| 882 | i = strlen(g.urlPath); |
| 883 | if( (i>0) && (params!=argv[1]) ){ |
| 884 | zSep = ""; |
| 885 | }else{ |
| 886 | zSep = "/"; |
| 887 | } |
| 888 | blob_appendf(&hdr, "%s %s%s%s HTTP/1.0\r\n", type, zSep, g.urlPath, params?params:""); |
| 889 | if( g.urlProxyAuth ){ |
| 890 | blob_appendf(&hdr, "Proxy-Authorization: %s\r\n", g.urlProxyAuth); |
| 891 | } |
| 892 | if( g.urlPasswd && g.urlUser && g.urlPasswd[0]=='#' ){ |
| 893 | char *zCredentials = mprintf("%s:%s", g.urlUser, &g.urlPasswd[1]); |
| 894 | char *zEncoded = encode64(zCredentials, -1); |
| 895 | blob_appendf(&hdr, "Authorization: Basic %s\r\n", zEncoded); |
| 896 | fossil_free(zEncoded); |
| 897 | fossil_free(zCredentials); |
| 898 | } |
| 899 | blob_appendf(&hdr, "Host: %s\r\n", g.urlHostname); |
| 900 | blob_appendf(&hdr, "User-Agent: Fossil/" RELEASE_VERSION |
| 901 | " (" MANIFEST_DATE " " MANIFEST_VERSION ")\r\n"); |
| 902 | blob_appendf(&hdr, "Content-Type: text/plain\r\n"); |
| 903 | blob_appendf(&hdr, "Content-Length: %d\r\n\r\n", blob_size(&payload)); |
| 904 | |
| 905 | transport_send(&hdr); |
| 906 | transport_send(&payload); |
| 907 | transport_close(); |
| 908 | g.urlProtocol=0; /* Make sure the url is not re-used. */ |
| 909 | Th_SetResult(interp, "", -1); |
| 910 | return TH_OK; |
| 911 | } |
| 912 | |
| 913 | static int commonScriptRan = 0; |
| 914 | |
| 915 | /* |
| 916 | ** Run the specified TH1 script, if any, and returns 1 on error. |
| 917 | */ |
| @@ -944,11 +855,10 @@ | |
| 944 | result = run_script("xfer-common-script", 0); |
| 945 | if( result == TH_ERROR ){ |
| 946 | /* Error message is left in th interpreter. */ |
| 947 | commonScriptRan = 2; |
| 948 | } |
| 949 | Th_CreateCommand(g.interp, "http", httpCmd, 0, 0); |
| 950 | } |
| 951 | return result; |
| 952 | } |
| 953 | |
| 954 | /* |
| 955 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -819,99 +819,10 @@ | |
| 819 | */ |
| 820 | static void server_private_xfer_not_authorized(void){ |
| 821 | @ error not\sauthorized\sto\ssync\sprivate\scontent |
| 822 | } |
| 823 | |
| 824 | static int commonScriptRan = 0; |
| 825 | |
| 826 | /* |
| 827 | ** Run the specified TH1 script, if any, and returns 1 on error. |
| 828 | */ |
| @@ -944,11 +855,10 @@ | |
| 855 | result = run_script("xfer-common-script", 0); |
| 856 | if( result == TH_ERROR ){ |
| 857 | /* Error message is left in th interpreter. */ |
| 858 | commonScriptRan = 2; |
| 859 | } |
| 860 | } |
| 861 | return result; |
| 862 | } |
| 863 | |
| 864 | /* |
| 865 |