]> granicus.if.org Git - apache/commitdiff
switch to APR 1.0 API (which is still in flux)
authorJeff Trawick <trawick@apache.org>
Wed, 3 Sep 2003 19:27:12 +0000 (19:27 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 3 Sep 2003 19:27:12 +0000 (19:27 +0000)
because of the changes to the argument lists of apr_mmap_dup and apr_socket_create,
2.1-dev won't build with apr and apr-util's 0.9 branch anymore

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101154 13f79535-47bb-0310-9956-ffa450edef68

43 files changed:
CHANGES
include/util_time.h
modules/arch/netware/mod_netware.c
modules/arch/win32/mod_isapi.c
modules/arch/win32/mod_win32.c
modules/cache/mod_file_cache.c
modules/dav/fs/lock.c
modules/dav/fs/repos.c
modules/experimental/mod_mem_cache.c
modules/filters/mod_include.c
modules/generators/mod_autoindex.c
modules/generators/mod_cgi.c
modules/generators/mod_cgid.c
modules/mappers/mod_negotiation.c
modules/mappers/mod_rewrite.c
modules/mappers/mod_userdir.c
modules/metadata/mod_ident.c
modules/proxy/proxy_connect.c
modules/proxy/proxy_ftp.c
modules/proxy/proxy_http.c
modules/proxy/proxy_util.c
modules/ssl/ssl_engine_init.c
modules/ssl/ssl_scache_dbm.c
os/beos/beosd.c
os/unix/unixd.c
server/config.c
server/connection.c
server/core.c
server/listen.c
server/main.c
server/mpm/beos/beos.c
server/mpm/experimental/perchild/perchild.c
server/mpm/mpmt_os2/mpmt_os2.c
server/mpm/mpmt_os2/mpmt_os2_child.c
server/mpm/netware/mpm_netware.c
server/mpm/winnt/mpm_winnt.c
server/mpm/winnt/nt_eventlog.c
server/mpm/worker/pod.c
server/mpm_common.c
server/request.c
server/util.c
server/util_script.c
support/ab.c

diff --git a/CHANGES b/CHANGES
index 40e9ff37589d927345d35485f2fc483c5363044b..11a66cedf58f5129f40916bf4e310e01f200b87c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@ Changes with Apache 2.1.0-dev
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) Switch to APR 1.0 API.
+
   *) Modify ap_get_client_block() to note if it has seen EOS.
      [Justin Erenkrantz]
 
index a0ef29cf2d9cc216899a3d91c9236f450970a9e9..ee5ecb08a48e893596e5589a0b4c999fc69d5431 100644 (file)
@@ -79,7 +79,7 @@ extern "C" {
  * @param tm the exploded time
  * @param t the time to explode: MUST be within the last
  *          AP_TIME_RECENT_THRESHOLD seconds
- * @note This is a faster alternative to apr_explode_localtime that uses
+ * @note This is a faster alternative to apr_time_exp_lt that uses
  *       a cache of pre-exploded time structures.  It is useful for things
  *       that need to explode the current time multiple times per second,
  *       like loggers.
index be111d0493a6fc11ba477c48baa99c48902292e0..45abac2633a7791bc4b1d9cfd58ca653847b4f3d 100644 (file)
@@ -170,7 +170,7 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
     *ptr = '\0';
 
     /* Figure out what the extension is so that we can matche it. */
-    ext = strrchr(apr_filename_of_pathname(cmd_only), '.');
+    ext = strrchr(apr_filepath_name_get(cmd_only), '.');
 
     /* If there isn't an extension then give it an empty string */
     if (!ext) {
index 73f86c2f25d15c9a0615960b863131b55f12be7c..05f5682894e9844adab8fa270ddcf0a6613e9629 100644 (file)
@@ -1646,7 +1646,7 @@ static int isapi_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *pte
 {
     apr_status_t rv;
 
-    apr_pool_sub_make(&loaded.pool, pconf, NULL);
+    apr_pool_create_ex(&loaded.pool, pconf, NULL, NULL);
     if (!loaded.pool) {
        ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, NULL,
                     "ISAPI: could not create the isapi cache pool");
index 937062046d63b8600b9ac66ba955c2c74e814a7b..2953765449b73d8e56a61f22c669d563b6cf9d2b 100644 (file)
@@ -447,7 +447,7 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
      * win32 parsing here, therefore the final extension is the only one
      * we will consider.
      */
-    ext = strrchr(apr_filename_of_pathname(*cmd), '.');
+    ext = strrchr(apr_filepath_name_get(*cmd), '.');
     
     /* If the file has an extension and it is not .com and not .exe and
      * we've been instructed to search the registry, then do so.
index d18d265ff92c15fd0c5562f749901c39262db6ec..646ba6f6dbac55e6f26b750bb419f194d56ba40a 100644 (file)
@@ -315,7 +315,7 @@ static int mmap_handler(request_rec *r, a_file *file)
     apr_mmap_t *mm;
     apr_bucket_brigade *bb = apr_brigade_create(r->pool, c->bucket_alloc);
 
-    apr_mmap_dup(&mm, file->mm, r->pool, 0);
+    apr_mmap_dup(&mm, file->mm, r->pool);
     b = apr_bucket_mmap_create(mm, 0, (apr_size_t)file->finfo.size,
                                c->bucket_alloc);
     APR_BRIGADE_INSERT_TAIL(bb, b);
index aa19c79e3b3c5194e6187f2a624c453b5b97e9f5..379bbf8f0e1f877481f7f06672df575257e15efa 100644 (file)
@@ -671,7 +671,7 @@ static dav_error * dav_fs_load_lock_record(dav_lockdb *lockdb, apr_datum_t key,
                     apr_status_t rv;
 
                    /* if we don't see the file, then it's a locknull */
-                    rv = apr_lstat(&finfo, fname, APR_FINFO_MIN, p);
+                    rv = apr_stat(&finfo, fname, APR_FINFO_MIN | APR_FINFO_LINK, p);
                    if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) {
                        if ((err = dav_fs_remove_locknull_member(p, fname, &buf)) != NULL) {
                             /* ### push a higher-level description? */
index 84babeda4bfee095cd4d4523ebe7284c68ac710a..5f1967117105ff1bd61df549afe31a3efb97bcd4 100644 (file)
@@ -1490,8 +1490,8 @@ static dav_error * dav_fs_walker(dav_fs_walker_context *fsctx, int depth)
 
 
         /* ### Optimize me, dirent can give us what we need! */
-        status = apr_lstat(&fsctx->info1.finfo, fsctx->path1.buf, 
-                           APR_FINFO_NORM, pool);
+        status = apr_stat(&fsctx->info1.finfo, fsctx->path1.buf, 
+                          APR_FINFO_NORM | APR_FINFO_LINK, pool);
         if (status != APR_SUCCESS && status != APR_INCOMPLETE) {
             /* woah! where'd it go? */
             /* ### should have a better error here */
index ad515be57dbc029a9c8a767342d00ae8c76223b3..c14bfe56e546b494aeb95d813cec4a96b87b8bfe 100644 (file)
@@ -949,7 +949,7 @@ static apr_status_t write_body(cache_handle_t *h, request_rec *r, apr_bucket_bri
             if (rv != APR_SUCCESS) {
                 return rv;
             }
-            apr_file_unset_inherit(tmpfile);
+            apr_file_inherit_unset(tmpfile);
             apr_os_file_get(&(mobj->fd), tmpfile);
 
             /* Open for business */
index 4be60e2524103afc3dead2056873dfef60867b68..cf1535c7a10c4fc00b94c04765af157067eecbbf 100644 (file)
@@ -678,7 +678,7 @@ static const char *add_include_vars_lazy(request_rec *r, const char *var)
         val = ap_ht_time(r->pool, r->finfo.mtime, conf->default_time_fmt, 0);
     }
     else if (!strcasecmp(var, "USER_NAME")) {
-        if (apr_get_username(&val, r->finfo.user, r->pool) != APR_SUCCESS) {
+        if (apr_uid_name_get(&val, r->finfo.user, r->pool) != APR_SUCCESS) {
             val = "<unknown>";
         }
     }
index 08243e979c7c37969437d1734a484d41147452b2..bccc2f1e19b6ffea9fe5880a03433137eed1a214 100644 (file)
@@ -812,7 +812,7 @@ static char *find_default_item(char *bogus_name, apr_array_header_t *list)
  */
 
 #ifdef CASE_BLIND_FILESYSTEM
-#define MATCH_FLAGS FNM_CASE_BLIND
+#define MATCH_FLAGS APR_FNM_CASE_BLIND
 #else
 #define MATCH_FLAGS 0
 #endif
@@ -1298,7 +1298,7 @@ static struct ent *make_autoindex_entry(const apr_finfo_t *dirent,
 
 #ifndef CASE_BLIND_FILESYSTEM
     if (pattern && (apr_fnmatch(pattern, dirent->name,
-                                FNM_NOESCAPE | FNM_PERIOD)
+                                APR_FNM_NOESCAPE | APR_FNM_PERIOD)
                         != APR_SUCCESS))
         return (NULL);
 #else  /* !CASE_BLIND_FILESYSTEM */
@@ -1308,7 +1308,7 @@ static struct ent *make_autoindex_entry(const apr_finfo_t *dirent,
          * reliably - so we have to granularise at the OS level.
          */
     if (pattern && (apr_fnmatch(pattern, dirent->name,
-                                FNM_NOESCAPE | FNM_PERIOD | FNM_CASE_BLIND)
+                                APR_FNM_NOESCAPE | APR_FNM_PERIOD | APR_FNM_CASE_BLIND)
                         != APR_SUCCESS))
         return (NULL);
 #endif /* !CASE_BLIND_FILESYSTEM */
index 2e6614b7862b7e86fdbc9708c2d6fff43ea8cc22..ed4e5bc05b83015837d707cfd2f6f94637151e50 100644 (file)
@@ -482,7 +482,7 @@ static apr_status_t run_cgi_child(apr_file_t **script_out,
             /* Bad things happened. Everyone should have cleaned up. */
             ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, rc, r,
                           "couldn't create child process: %d: %s", rc,
-                          apr_filename_of_pathname(r->filename));
+                          apr_filepath_name_get(r->filename));
         }
         else {
             apr_pool_note_subprocess(p, procnew, APR_KILL_AFTER_TIMEOUT);
@@ -607,7 +607,7 @@ static int cgi_handler(request_rec *r)
         return DECLINED;
     }
 
-    argv0 = apr_filename_of_pathname(r->filename);
+    argv0 = apr_filepath_name_get(r->filename);
     nph = !(strncmp(argv0, "nph-", 4));
     conf = ap_get_module_config(r->server->module_config, &cgi_module);
 
index 0e3fca883877ea617f4932d172a1d5c1e7ad6d49..11bdc427fb9bf4b8eb17016a3b4810dce585cf19 100644 (file)
@@ -775,7 +775,7 @@ static int cgid_server(void *data)
                  */
                 ap_log_error(APLOG_MARK, APLOG_ERR, rc, r->server,
                              "couldn't create child process: %d: %s", rc, 
-                             apr_filename_of_pathname(r->filename));
+                             apr_filepath_name_get(r->filename));
             }
             else {
                 apr_hash_set(script_hash, &cgid_req.conn_id, sizeof(cgid_req.conn_id), 
index 1808d2862490c6f56c57f3caf739e78893477d77..c63149690892aaa941db51417106abdaf22e8834 100644 (file)
@@ -1066,7 +1066,7 @@ static int read_type_map(apr_file_t **map, negotiation_state *neg,
                      break;
                 }
                 mime_info.bytes = len;
-                mime_info.file_name = apr_filename_of_pathname(rr->filename);
+                mime_info.file_name = apr_filepath_name_get(rr->filename);
             }
         }
         else {
index 1b0176734ad9a42195adf477462c0393415a2764..e62e22c55944f857e20ac186ed631a6fab892346 100644 (file)
@@ -3376,7 +3376,7 @@ static int apply_rewrite_cond(rewritecond_entry *p, rewrite_ctx *ctx)
 
     case CONDPAT_FILE_LINK:
 #if !defined(OS2)
-        if (   apr_lstat(&sb, input, APR_FINFO_MIN, r->pool) == APR_SUCCESS
+        if (   apr_stat(&sb, input, APR_FINFO_MIN | APR_FINFO_LINK, r->pool) == APR_SUCCESS
             && sb.filetype == APR_LNK) {
             rc = 1;
         }
index 75327980a91365ddbc95696a72e5db44d0576984..c054b5a61e509e0112a8308b1f23bc3a96008a49 100644 (file)
@@ -325,7 +325,7 @@ static int translate_userdir(request_rec *r)
 #if APR_HAS_USER
             char *homedir;
 
-            if (apr_get_home_directory(&homedir, w, r->pool) == APR_SUCCESS) {
+            if (apr_uid_homepath_get(&homedir, w, r->pool) == APR_SUCCESS) {
                 filename = apr_pstrcat(r->pool, homedir, "/", userdir, NULL);
             }
 #else
@@ -376,7 +376,7 @@ static ap_unix_identity_t *get_suexec_id_doer(const request_rec *r)
         return NULL;
     }
 
-    if (apr_get_userid(&ugid->uid, &ugid->gid, username, r->pool) != APR_SUCCESS) {
+    if (apr_uid_get(&ugid->uid, &ugid->gid, username, r->pool) != APR_SUCCESS) {
         return NULL;
     }
 
index 4d1682016e050265cb574bc45b341a08ddb93cdd..1d19b39dfbb64537b5a3125e15288f090c637617 100644 (file)
@@ -158,7 +158,7 @@ static apr_status_t rfc1413_connect(apr_socket_t **newsock, conn_rec *conn,
 
     if ((rv = apr_socket_create(newsock,
                                 localsa->family, /* has to match */
-                                SOCK_STREAM, conn->pool)) != APR_SUCCESS) {
+                                SOCK_STREAM, 0, conn->pool)) != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_CRIT, rv, srv,
                      "rfc1413: error creating query socket");
         return rv;
@@ -180,7 +180,7 @@ static apr_status_t rfc1413_connect(apr_socket_t **newsock, conn_rec *conn,
  * addresses from the query socket.
  */
 
-    if ((rv = apr_bind(*newsock, localsa)) != APR_SUCCESS) {
+    if ((rv = apr_socket_bind(*newsock, localsa)) != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_CRIT, rv, srv,
                      "rfc1413: Error binding query socket to local port");
         apr_socket_close(*newsock);
@@ -191,7 +191,7 @@ static apr_status_t rfc1413_connect(apr_socket_t **newsock, conn_rec *conn,
  * errors from connect usually imply the remote machine doesn't support
  * the service; don't log such an error
  */
-    if ((rv = apr_connect(*newsock, destsa)) != APR_SUCCESS) {
+    if ((rv = apr_socket_connect(*newsock, destsa)) != APR_SUCCESS) {
         apr_socket_close(*newsock);
         return rv;
     }
@@ -223,7 +223,7 @@ static apr_status_t rfc1413_query(apr_socket_t *sock, conn_rec *conn,
     while (i < buflen) {
         apr_size_t j = strlen(buffer + i);
         apr_status_t status;
-        status  = apr_send(sock, buffer+i, &j);
+        status  = apr_socket_send(sock, buffer+i, &j);
         if (status != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv,
                          "write: rfc1413: error sending request");
@@ -249,7 +249,7 @@ static apr_status_t rfc1413_query(apr_socket_t *sock, conn_rec *conn,
     while((cp = strchr(buffer, '\012')) == NULL && i < sizeof(buffer) - 1) {
         apr_size_t j = sizeof(buffer) - 1 - i;
         apr_status_t status;
-        status = apr_recv(sock, buffer+i, &j);
+        status = apr_socket_recv(sock, buffer+i, &j);
         if (status != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv,
                          "read: rfc1413: error reading response");
index 057b1ce7fe2c902fa163ee7792758433d96a2c02..e755335489f8c0ff670ad662742bb931e2ae25b3 100644 (file)
@@ -267,10 +267,10 @@ int ap_proxy_connect_handler(request_rec *r, proxy_server_conf *conf,
                     "proxy: CONNECT: sending the CONNECT request to the remote proxy");
         nbytes = apr_snprintf(buffer, sizeof(buffer),
                              "CONNECT %s HTTP/1.0" CRLF, r->uri);
-        apr_send(sock, buffer, &nbytes);
+        apr_socket_send(sock, buffer, &nbytes);
         nbytes = apr_snprintf(buffer, sizeof(buffer),
                              "Proxy-agent: %s" CRLF CRLF, ap_get_server_version());
-        apr_send(sock, buffer, &nbytes);
+        apr_socket_send(sock, buffer, &nbytes);
     }
     else {
         ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
@@ -278,11 +278,11 @@ int ap_proxy_connect_handler(request_rec *r, proxy_server_conf *conf,
         nbytes = apr_snprintf(buffer, sizeof(buffer),
                              "HTTP/1.0 200 Connection Established" CRLF);
         ap_xlate_proto_to_ascii(buffer, nbytes);
-        apr_send(client_socket, buffer, &nbytes);
+        apr_socket_send(client_socket, buffer, &nbytes);
         nbytes = apr_snprintf(buffer, sizeof(buffer),
                              "Proxy-agent: %s" CRLF CRLF, ap_get_server_version());
         ap_xlate_proto_to_ascii(buffer, nbytes);
-        apr_send(client_socket, buffer, &nbytes);
+        apr_socket_send(client_socket, buffer, &nbytes);
 #if 0
         /* This is safer code, but it doesn't work yet.  I'm leaving it 
          * here so that I can fix it later.
@@ -336,7 +336,7 @@ int ap_proxy_connect_handler(request_rec *r, proxy_server_conf *conf,
 /*             ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                              "proxy: CONNECT: sock was set");*/
                 nbytes = sizeof(buffer);
-                if (apr_recv(sock, buffer, &nbytes) == APR_SUCCESS) {
+                if (apr_socket_recv(sock, buffer, &nbytes) == APR_SUCCESS) {
                     o = 0;
                     i = nbytes;
                     while(i > 0)
@@ -348,7 +348,7 @@ int ap_proxy_connect_handler(request_rec *r, proxy_server_conf *conf,
      * if ((nbytes = ap_rwrite(buffer + o, nbytes, r)) < 0)
      * rbb
      */
-                        if (apr_send(client_socket, buffer + o, &nbytes) != APR_SUCCESS)
+                        if (apr_socket_send(client_socket, buffer + o, &nbytes) != APR_SUCCESS)
                            break;
                         o += nbytes;
                         i -= nbytes;
@@ -366,13 +366,13 @@ int ap_proxy_connect_handler(request_rec *r, proxy_server_conf *conf,
 /*             ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                              "proxy: CONNECT: client was set");*/
                 nbytes = sizeof(buffer);
-                if (apr_recv(client_socket, buffer, &nbytes) == APR_SUCCESS) {
+                if (apr_socket_recv(client_socket, buffer, &nbytes) == APR_SUCCESS) {
                     o = 0;
                     i = nbytes;
                     while(i > 0)
                     {
                        nbytes = i;
-                       if (apr_send(sock, buffer + o, &nbytes) != APR_SUCCESS)
+                       if (apr_socket_send(sock, buffer + o, &nbytes) != APR_SUCCESS)
                            break;
                         o += nbytes;
                         i -= nbytes;
index c38773cb6b6f6dae9a4265351c6996404e6fe116..8df516a6805c1540a1c38f09fd3a91758de0d63e 100644 (file)
@@ -954,7 +954,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf,
         int failed = 1;
         while (connect_addr) {
 
-           if ((rv = apr_socket_create(&sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) {
+           if ((rv = apr_socket_create(&sock, connect_addr->family, SOCK_STREAM, 0, r->pool)) != APR_SUCCESS) {
                ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                              "proxy: FTP: error creating socket");
                 connect_addr = connect_addr->next;
@@ -993,7 +993,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf,
                          connect_addr->family, connect_addr, connectname);
 
             /* make the connection out of the socket */
-            rv = apr_connect(sock, connect_addr);
+            rv = apr_socket_connect(sock, connect_addr);
 
             /* if an error occurred, loop round and try again */
             if (rv != APR_SUCCESS) {
@@ -1272,7 +1272,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf,
                        "proxy: FTP: EPSV contacting remote host on port %d",
                              data_port);
 
-                if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) {
+                if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, 0, r->pool)) != APR_SUCCESS) {
                     ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                                   "proxy: FTP: error creating EPSV socket");
                     return HTTP_INTERNAL_SERVER_ERROR;
@@ -1291,7 +1291,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf,
                 apr_socket_addr_get(&data_addr, APR_REMOTE, sock);
                 apr_sockaddr_ip_get(&data_ip, data_addr);
                 apr_sockaddr_info_get(&epsv_addr, data_ip, connect_addr->family, data_port, 0, p);
-                rv = apr_connect(data_sock, epsv_addr);
+                rv = apr_socket_connect(data_sock, epsv_addr);
                 if (rv != APR_SUCCESS) {
                     ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                                  "proxy: FTP: EPSV attempt to connect to %pI failed - Firewall/NAT?", epsv_addr);
@@ -1359,7 +1359,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf,
                           "proxy: FTP: PASV contacting host %d.%d.%d.%d:%d",
                              h3, h2, h1, h0, pasvport);
 
-                if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) {
+                if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, 0, r->pool)) != APR_SUCCESS) {
                     ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                                   "proxy: error creating PASV socket");
                     return HTTP_INTERNAL_SERVER_ERROR;
@@ -1376,7 +1376,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf,
 
                 /* make the connection */
                 apr_sockaddr_info_get(&pasv_addr, apr_psprintf(p, "%d.%d.%d.%d", h3, h2, h1, h0), connect_addr->family, pasvport, 0, p);
-                rv = apr_connect(data_sock, pasv_addr);
+                rv = apr_socket_connect(data_sock, pasv_addr);
                 if (rv != APR_SUCCESS) {
                     ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
                                  "proxy: FTP: PASV attempt to connect to %pI failed - Firewall/NAT?", pasv_addr);
@@ -1402,7 +1402,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf,
         apr_port_t local_port;
         unsigned int h0, h1, h2, h3, p0, p1;
 
-        if ((rv = apr_socket_create(&local_sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) {
+        if ((rv = apr_socket_create(&local_sock, connect_addr->family, SOCK_STREAM, 0, r->pool)) != APR_SUCCESS) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                           "proxy: FTP: error creating local socket");
             return HTTP_INTERNAL_SERVER_ERROR;
@@ -1422,14 +1422,14 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf,
 
         apr_sockaddr_info_get(&local_addr, local_ip, APR_UNSPEC, local_port, 0, r->pool);
 
-        if ((rv = apr_bind(local_sock, local_addr)) != APR_SUCCESS) {
+        if ((rv = apr_socket_bind(local_sock, local_addr)) != APR_SUCCESS) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
             "proxy: FTP: error binding to ftp data socket %pI", local_addr);
             return HTTP_INTERNAL_SERVER_ERROR;
         }
 
         /* only need a short queue */
-        if ((rv = apr_listen(local_sock, 2)) != APR_SUCCESS) {
+        if ((rv = apr_socket_listen(local_sock, 2)) != APR_SUCCESS) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                           "proxy: FTP: error listening to ftp data socket %pI", local_addr);
             return HTTP_INTERNAL_SERVER_ERROR;
@@ -1766,7 +1766,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf,
     /* wait for connection */
     if (use_port) {
         for (;;) {
-            rv = apr_accept(&data_sock, local_sock, r->pool);
+            rv = apr_socket_accept(&data_sock, local_sock, r->pool);
             if (rv == APR_EINTR) {
                 continue;
             }
index e71d54b707c62d1ddfd23a5b740815dbde941561..a3250865c03d693fb8dec312c24eb467c865b5c4 100644 (file)
@@ -330,7 +330,7 @@ apr_status_t ap_proxy_http_create_connection(apr_pool_t *p, request_rec *r,
         apr_socket_timeout_get(p_conn->sock, &current_timeout);
         /* set no timeout */
         apr_socket_timeout_set(p_conn->sock, 0);
-        socket_status = apr_recv(p_conn->sock, test_buffer, &buffer_len);
+        socket_status = apr_socket_recv(p_conn->sock, test_buffer, &buffer_len);
         /* put back old timeout */
         apr_socket_timeout_set(p_conn->sock, current_timeout);
         if ( APR_STATUS_IS_EOF(socket_status) ) {
index 0b23bf8b56950e26d3392bbbe706484af8779c9d..bbbb437cba1a64e95d62f9eaa7e64635ace4656c 100644 (file)
@@ -1167,7 +1167,7 @@ PROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **newsock,
     
     while (backend_addr && !connected) {
         if ((rv = apr_socket_create(newsock, backend_addr->family,
-                                    SOCK_STREAM, p)) != APR_SUCCESS) {
+                                    SOCK_STREAM, 0, p)) != APR_SUCCESS) {
             loglevel = backend_addr->next ? APLOG_DEBUG : APLOG_ERR;
             ap_log_error(APLOG_MARK, loglevel, rv, s,
                          "proxy: %s: error creating fam %d socket for target %s",
@@ -1205,7 +1205,7 @@ PROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **newsock,
                      proxy_function, backend_addr->family, backend_name);
 
         /* make the connection out of the socket */
-        rv = apr_connect(*newsock, backend_addr);
+        rv = apr_socket_connect(*newsock, backend_addr);
 
         /* if an error occurred, loop round and try again */
         if (rv != APR_SUCCESS) {
index 3927ca180ba0b55b41c550fbe202b0046ac23f8c..2885925dae6555ba5a4eaeb766ef6d0e36c91410 100644 (file)
@@ -852,11 +852,11 @@ static void ssl_check_public_cert(server_rec *s,
     }
 
     if (SSL_X509_getCN(ptemp, cert, &cn)) {
-        int fnm_flags = FNM_PERIOD|FNM_CASE_BLIND;
+        int fnm_flags = APR_FNM_PERIOD|APR_FNM_CASE_BLIND;
 
         if (apr_fnmatch_test(cn) &&
             (apr_fnmatch(cn, s->server_hostname,
-                         fnm_flags) == FNM_NOMATCH))
+                         fnm_flags) == APR_FNM_NOMATCH))
         {
             ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s,
                          "%s server certificate wildcard CommonName (CN) `%s' "
index b9caa6bff4ae25e62f655524b7b09c2f86b6fb15..abcfa8d1c2e5493dbe901c472dda8ce1577a3050 100644 (file)
@@ -118,7 +118,7 @@ void ssl_scache_dbm_kill(server_rec *s)
     SSLModConfigRec *mc = myModConfig(s);
     apr_pool_t *p;
 
-    apr_pool_sub_make(&p, mc->pPool, NULL);
+    apr_pool_create_ex(&p, mc->pPool, NULL, NULL);
     if (p != NULL) {
         /* the correct way */
         unlink(apr_pstrcat(p, mc->szSessionCacheDataFile, SSL_DBM_FILE_SUFFIX_DIR, NULL));
@@ -350,7 +350,7 @@ void ssl_scache_dbm_expire(server_rec *s)
     ssl_mutex_on(s);
     for (;;) {
         /* allocate the key array in a memory sub pool */
-        apr_pool_sub_make(&p, mc->pPool, NULL);
+        apr_pool_create_ex(&p, mc->pPool, NULL, NULL);
         if (p == NULL)
             break;
         if ((keylist = apr_palloc(p, sizeof(dbmkey)*KEYMAX)) == NULL) {
index 29b1fa116ca4bf27bdaf0c9104f0fa70ba7a8ed5..be12a5fd7fd4b4e7bd26fd50987a21eabaa28c57 100644 (file)
@@ -119,7 +119,7 @@ AP_DECLARE(apr_status_t) beosd_accept(void **accepted, ap_listen_rec *lr,
     apr_status_t status;
     int sockdes;
 
-    status = apr_accept(&csd, lr->sd, ptrans);
+    status = apr_socket_accept(&csd, lr->sd, ptrans);
     if (status == APR_SUCCESS) { 
         *accepted = csd;
         apr_os_sock_get(&sockdes, csd);
@@ -195,13 +195,13 @@ AP_DECLARE(apr_status_t) beosd_accept(void **accepted, ap_listen_rec *lr,
              * occur in mobile IP.
              */
             ap_log_error(APLOG_MARK, APLOG_EMERG, status, ap_server_conf,
-                         "apr_accept: giving up.");
+                         "apr_socket_accept: giving up.");
             return APR_EGENERAL;
 #endif /*ENETDOWN*/
 
         default:
             ap_log_error(APLOG_MARK, APLOG_ERR, status, ap_server_conf,
-                         "apr_accept: (client socket)");
+                         "apr_socket_accept: (client socket)");
             return APR_EGENERAL;
     }
     return status;
index d5b6c90b8e92e0a83dbadf6bd14f9462a3a5c40f..595d6f6777a628b688b04d1dbf964380f54c73d7 100644 (file)
@@ -504,7 +504,7 @@ AP_DECLARE(apr_status_t) unixd_accept(void **accepted, ap_listen_rec *lr,
     int sockdes;
 
     *accepted = NULL;
-    status = apr_accept(&csd, lr->sd, ptrans);
+    status = apr_socket_accept(&csd, lr->sd, ptrans);
     if (status == APR_SUCCESS) { 
         *accepted = csd;
         apr_os_sock_get(&sockdes, csd);
@@ -608,7 +608,7 @@ AP_DECLARE(apr_status_t) unixd_accept(void **accepted, ap_listen_rec *lr,
              * occur in mobile IP.
              */
             ap_log_error(APLOG_MARK, APLOG_EMERG, status, ap_server_conf,
-                         "apr_accept: giving up.");
+                         "apr_socket_accept: giving up.");
             return APR_EGENERAL;
 #endif /*ENETDOWN*/
 
@@ -625,7 +625,7 @@ AP_DECLARE(apr_status_t) unixd_accept(void **accepted, ap_listen_rec *lr,
 #else
         default:
             ap_log_error(APLOG_MARK, APLOG_ERR, status, ap_server_conf,
-                         "apr_accept: (client socket)");
+                         "apr_socket_accept: (client socket)");
             return APR_EGENERAL;
 #endif
     }
index 86daeeb66698133919a17f00e24c7129ecdec5b5..9a8a72853341d2eaf87ec09016becaa7d230290a 100644 (file)
@@ -1549,7 +1549,7 @@ AP_DECLARE(void) ap_process_resource_config(server_rec *s, const char *fname,
         && !(strcmp(fname, ap_server_root_relative(p, SERVER_CONFIG_FILE)))) {
         apr_finfo_t finfo;
 
-        if (apr_lstat(&finfo, fname, APR_FINFO_TYPE, p) != APR_SUCCESS)
+        if (apr_stat(&finfo, fname, APR_FINFO_LINK | APR_FINFO_TYPE, p) != APR_SUCCESS)
             return;
     }
 
@@ -1608,7 +1608,7 @@ AP_DECLARE(void) ap_process_resource_config(server_rec *s, const char *fname,
             if (strcmp(dirent.name, ".")
                 && strcmp(dirent.name, "..")
                 && (apr_fnmatch(pattern, dirent.name,
-                                FNM_PERIOD) == APR_SUCCESS)) {
+                                APR_FNM_PERIOD) == APR_SUCCESS)) {
                 fnew = (fnames *) apr_array_push(candidates);
                 fnew->fname = ap_make_full_path(p, path, dirent.name);
             }
index 8d88e147fb4b8f69c378f4cbeac36f4dd8a250bb..9bbdb7968c312186520e2b3ce30fa9f7b61d5e57 100644 (file)
@@ -167,7 +167,7 @@ AP_DECLARE(void) ap_lingering_close(conn_rec *c)
     /* Shut down the socket for write, which will send a FIN
      * to the peer.
      */
-    if (apr_shutdown(csd, APR_SHUTDOWN_WRITE) != APR_SUCCESS
+    if (apr_socket_shutdown(csd, APR_SHUTDOWN_WRITE) != APR_SUCCESS
         || c->aborted) {
         apr_socket_close(csd);
         return;
@@ -183,7 +183,7 @@ AP_DECLARE(void) ap_lingering_close(conn_rec *c)
     apr_socket_opt_set(csd, APR_INCOMPLETE_READ, 1);
     while (1) {
         nbytes = sizeof(dummybuf);
-        rc = apr_recv(csd, dummybuf, &nbytes);
+        rc = apr_socket_recv(csd, dummybuf, &nbytes);
         if (rc != APR_SUCCESS || nbytes == 0)
             break;
 
index 79779e7add5b924ce87b06a98be0aa2ef53db910..e5f5ef0da71d35a41adfe46d7b753d775f9d4ba2 100644 (file)
@@ -2845,7 +2845,7 @@ static apr_status_t writev_it_all(apr_socket_t *s,
 
     /* XXX handle checking for non-blocking socket */
     while (bytes_written != len) {
-        rv = apr_sendv(s, vec + i, nvec - i, &n);
+        rv = apr_socket_sendv(s, vec + i, nvec - i, &n);
         bytes_written += n;
         if (rv != APR_SUCCESS)
             return rv;
@@ -2853,7 +2853,7 @@ static apr_status_t writev_it_all(apr_socket_t *s,
         *nbytes += n;
 
         /* If the write did not complete, adjust the iovecs and issue
-         * apr_sendv again
+         * apr_socket_sendv again
          */
         if (bytes_written < len) {
             /* Skip over the vectors that have already been written */
@@ -2908,8 +2908,8 @@ static apr_status_t sendfile_it_all(core_net_rec *c,
     do {
         apr_size_t tmplen = file_bytes_left;
 
-        rv = apr_sendfile(c->client_socket, fd, hdtr, &file_offset, &tmplen,
-                          flags);
+        rv = apr_socket_sendfile(c->client_socket, fd, hdtr, &file_offset, &tmplen,
+                                 flags);
         *bytes_sent += tmplen;
         total_bytes_left -= tmplen;
         if (!total_bytes_left || rv != APR_SUCCESS) {
@@ -3019,7 +3019,7 @@ static apr_status_t emulate_sendfile(core_net_rec *c, apr_file_t *fd,
         rv = apr_file_read(fd, buffer, &sendlen);
         while (rv == APR_SUCCESS && sendlen) {
             bytes_sent = sendlen;
-            rv = apr_send(c->client_socket, &buffer[o], &bytes_sent);
+            rv = apr_socket_send(c->client_socket, &buffer[o], &bytes_sent);
             if (rv == APR_SUCCESS) {
                 sendlen -= bytes_sent; /* sendlen != bytes_sent ==> partial write */
                 o += bytes_sent;       /* o is where we are in the buffer */
index 49a115a3a6909b1c7a9e7e8c9f33b570e03d7f10..778894e5a9dda03a54a0de8cf1d5e299b2599dfb 100644 (file)
@@ -159,7 +159,7 @@ static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server)
     ap_sock_disable_nagle(s);
 #endif
 
-    if ((stat = apr_bind(s, server->bind_addr)) != APR_SUCCESS) {
+    if ((stat = apr_socket_bind(s, server->bind_addr)) != APR_SUCCESS) {
         ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, stat, p,
                       "make_sock: could not bind to address %pI",
                       server->bind_addr);
@@ -167,7 +167,7 @@ static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server)
         return stat;
     }
 
-    if ((stat = apr_listen(s, ap_listenbacklog)) != APR_SUCCESS) {
+    if ((stat = apr_socket_listen(s, ap_listenbacklog)) != APR_SUCCESS) {
         ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_ERR, stat, p,
                       "make_sock: unable to listen for connections "
                       "on address %pI",
@@ -295,7 +295,7 @@ static const char *alloc_listener(process_rec *process, char *addr, apr_port_t p
         sa = sa->next;
 
         status = apr_socket_create(&new->sd, new->bind_addr->family,
-                                    SOCK_STREAM, process->pool);
+                                    SOCK_STREAM, 0, process->pool);
 
 #if APR_HAVE_IPV6
         /* What could happen is that we got an IPv6 address, but this system
index 993d8e4553aba012d783aeab035a1f979f2fbdf7..9016a309982ff2d3be9461ce97c85052771e8f15 100644 (file)
@@ -281,7 +281,7 @@ static process_rec *create_process(int argc, const char * const *argv)
     apr_pool_tag(process->pconf, "pconf");
     process->argc = argc;
     process->argv = argv;
-    process->short_name = apr_filename_of_pathname(argv[0]);
+    process->short_name = apr_filepath_name_get(argv[0]);
     return process;
 }
 
index 2c68d69eaf0e739cd791375cae4293657bc05df4..fa511b2eb4fec5fca0553866fd768c3d75ff3022 100644 (file)
@@ -267,7 +267,7 @@ static void tell_workers_to_exit(void)
     int i = 0;
     for (i = 0 ; i < ap_max_child_assigned; i++){
         len = 4;
-        if (apr_sendto(udp_sock, udp_sa, 0, "die!", &len) != APR_SUCCESS)
+        if (apr_socket_sendto(udp_sock, udp_sa, 0, "die!", &len) != APR_SUCCESS)
             break;
     }   
 }
@@ -443,7 +443,7 @@ static int32 worker_thread(void * dummy)
                     char *tmpbuf = apr_palloc(ptrans, sizeof(char) * 5);
                     apr_sockaddr_info_get(&rec_sa, "127.0.0.1", APR_UNSPEC, 7772, 0, ptrans);
                     
-                    if ((ret = apr_recvfrom(rec_sa, listening_sockets[0], 0, tmpbuf, &len))
+                    if ((ret = apr_socket_recvfrom(rec_sa, listening_sockets[0], 0, tmpbuf, &len))
                         != APR_SUCCESS){
                         ap_log_error(APLOG_MARK, APLOG_ERR, ret, NULL, 
                             "error getting data from UDP!!");
@@ -483,12 +483,12 @@ static int32 worker_thread(void * dummy)
     got_fd:
 
         if (!this_worker_should_exit) {
-            rv = apr_accept(&csd, sd, ptrans);
+            rv = apr_socket_accept(&csd, sd, ptrans);
 
             apr_thread_mutex_unlock(accept_mutex);
             if (rv != APR_SUCCESS) {
                 ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf,
-                  "apr_accept");
+                  "apr_socket_accept");
             } else {
                 process_socket(ptrans, csd, child_slot, bucket_alloc);
                 requests_this_child--;
@@ -795,13 +795,13 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
             "couldn't create control socket information, shutting down");
         return 1;
     }
-    if (apr_socket_create(&udp_sock, udp_sa->family, SOCK_DGRAM,
-                      _pconf) != APR_SUCCESS){
+    if (apr_socket_create(&udp_sock, udp_sa->family, SOCK_DGRAM, 0,
+                          _pconf) != APR_SUCCESS){
         ap_log_error(APLOG_MARK, APLOG_ALERT, errno, s,
             "couldn't create control socket, shutting down");
         return 1;
     }
-    if (apr_bind(udp_sock, udp_sa) != APR_SUCCESS){
+    if (apr_socket_bind(udp_sock, udp_sa) != APR_SUCCESS){
         ap_log_error(APLOG_MARK, APLOG_ALERT, errno, s,
             "couldn't bind UDP socket!");
         return 1;
index ba6f792e272a011822807824c5b41b459f7e1e5c..c8350db6664e7df639ba96d05a660957a27db6d3 100644 (file)
@@ -605,7 +605,7 @@ static apr_status_t check_pipe_of_death(void **csd, ap_listen_rec *lr,
         char pipe_read_char;
         apr_size_t n = 1;
 
-        ret = apr_recv(lr->sd, &pipe_read_char, &n);
+        ret = apr_socket_recv(lr->sd, &pipe_read_char, &n);
         if (APR_STATUS_IS_EAGAIN(ret)) {
             /* It lost the lottery. It must continue to suffer
              * through a life of servitude. */
index 214834cad4c6e2251c44648a00c0a98e6af200b5..a37264b8d88cb34e9e3ede52abcb90fb830f354c 100644 (file)
@@ -182,7 +182,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s )
             apr_sockaddr_info_get(&lr->bind_addr, "0.0.0.0", APR_UNSPEC,
                                   DEFAULT_HTTP_PORT, 0, s->process->pool);
             apr_socket_create(&lr->sd, lr->bind_addr->family,
-                              SOCK_STREAM, s->process->pool);
+                              SOCK_STREAM, 0, s->process->pool);
         }
 
         for (lr = ap_listeners; lr; lr = lr->next) {
index af55e6de2893d896d7258ae576f101ce3eaed8e2..25c202e8b9151a7ea73216cffcfadc2839f8a3c3 100644 (file)
@@ -239,7 +239,7 @@ void ap_mpm_child_main(apr_pool_t *pconf)
         worker_args->pconn = pconn;
 
         if (num_listeners == 1) {
-            rv = apr_accept(&worker_args->conn_sd, ap_listeners->sd, pconn);
+            rv = apr_socket_accept(&worker_args->conn_sd, ap_listeners->sd, pconn);
         } else {
             rc = DosRequestMutexSem(ap_mpm_accept_mutex, SEM_INDEFINITE_WAIT);
 
@@ -287,14 +287,14 @@ void ap_mpm_child_main(apr_pool_t *pconf)
                 }
 
                 sd = lr->sd;
-                rv = apr_accept(&worker_args->conn_sd, sd, pconn);
+                rv = apr_socket_accept(&worker_args->conn_sd, sd, pconn);
             }
         }
 
         if (rv != APR_SUCCESS) {
             if (!APR_STATUS_IS_EINTR(rv)) {
                 ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf,
-                             "apr_accept");
+                             "apr_socket_accept");
                 clean_child_exit(APEXIT_CHILDFATAL);
             }
         } else {
index 4c206ab42f728c59a60c55b06e80d64abeffc3f5..8be51cc6d5667514d2f7d1b70e4940680e881f67 100644 (file)
@@ -461,7 +461,7 @@ void worker_main(void *arg)
             wouldblock_retry = MAX_WB_RETRIES;
 
             while (wouldblock_retry) {
-                if ((stat = apr_accept(&csd, sd, ptrans)) == APR_SUCCESS) {
+                if ((stat = apr_socket_accept(&csd, sd, ptrans)) == APR_SUCCESS) {
                     break;
                 }
                 else {
@@ -523,13 +523,13 @@ void worker_main(void *arg)
                         * occur in mobile IP.
                         */
                         ap_log_error(APLOG_MARK, APLOG_EMERG, stat, ap_server_conf,
-                            "apr_accept: giving up.");
+                            "apr_socket_accept: giving up.");
                         clean_child_exit(APEXIT_CHILDFATAL, my_worker_num, ptrans, 
                                          bucket_alloc);
                 }
                 else {
                         ap_log_error(APLOG_MARK, APLOG_ERR, stat, ap_server_conf,
-                            "apr_accept: (client socket)");
+                            "apr_socket_accept: (client socket)");
                         clean_child_exit(1, my_worker_num, ptrans, bucket_alloc);
                 }
             }
index 14bf7d43c9c405ba30135b8eff85f3626097ec08..fb0d290527adff51117a41bb992f748fed2ee5c6 100644 (file)
@@ -672,7 +672,7 @@ static int create_process(apr_pool_t *p, HANDLE *child_proc, HANDLE *child_exit_
     char *cmd;
     char *cwd;
 
-    apr_pool_sub_make(&ptemp, p, NULL);
+    apr_pool_create_ex(&ptemp, p, NULL, NULL);
 
     /* Build the command line. Should look something like this:
      * C:/apache/bin/apache.exe -f ap_server_confname 
@@ -1190,10 +1190,10 @@ void winnt_rewrite_args(process_rec *process)
     /* WARNING: There is an implict assumption here that the
      * executable resides in ServerRoot or ServerRoot\bin
      */
-    def_server_root = (char *) apr_filename_of_pathname(binpath);
+    def_server_root = (char *) apr_filepath_name_get(binpath);
     if (def_server_root > binpath) {
         *(def_server_root - 1) = '\0';
-        def_server_root = (char *) apr_filename_of_pathname(binpath);
+        def_server_root = (char *) apr_filepath_name_get(binpath);
         if (!strcasecmp(def_server_root, "bin"))
             *(def_server_root - 1) = '\0';
     }
index 53151ddfaeb1b196c2a50f2e9fcf8b0fc44c419e..254a1fe678b04b9044e3e64513815524154b10c7 100644 (file)
@@ -81,7 +81,7 @@ static DWORD WINAPI service_stderr_thread(LPVOID hPipe)
     apr_status_t rv;
     apr_pool_t *p;
     
-    apr_pool_sub_make(&p, NULL, NULL);
+    apr_pool_create_ex(&p, NULL, NULL, NULL);
 
     errarg[0] = "The Apache service named";
     errarg[1] = display_name;
index b603c07e7419aaf355627e141f31d3097cda2b5d..dbcd1f614c72f41de3ca9fa2acfb75d8920fccfd 100644 (file)
@@ -77,8 +77,8 @@ AP_DECLARE(apr_status_t) ap_mpm_pod_open(apr_pool_t *p, ap_pod_t **pod)
     (*pod)->p = p;
     
     /* close these before exec. */
-    apr_file_unset_inherit((*pod)->pod_in);
-    apr_file_unset_inherit((*pod)->pod_out);
+    apr_file_inherit_unset((*pod)->pod_in);
+    apr_file_inherit_unset((*pod)->pod_out);
 
     return APR_SUCCESS;
 }
index 0fc9d8d3ba60d49648ef4903dd01c9a0098fe3a9..214c1be94f0fe2b8c6c0ab2e546c3c9db2db3d00 100644 (file)
@@ -414,8 +414,8 @@ AP_DECLARE(apr_status_t) ap_mpm_pod_open(apr_pool_t *p, ap_pod_t **pod)
                           APR_UNSPEC, ap_listeners->bind_addr->port, 0, p);
 
     /* close these before exec. */
-    apr_file_unset_inherit((*pod)->pod_in);
-    apr_file_unset_inherit((*pod)->pod_out);
+    apr_file_inherit_unset((*pod)->pod_in);
+    apr_file_inherit_unset((*pod)->pod_out);
 
     return APR_SUCCESS;
 }
@@ -488,7 +488,7 @@ static apr_status_t dummy_connection(ap_pod_t *pod)
         return rv;
     }
 
-    rv = apr_socket_create(&sock, pod->sa->family, SOCK_STREAM, p);
+    rv = apr_socket_create(&sock, pod->sa->family, SOCK_STREAM, 0, p);
     if (rv != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf,
                      "get socket to connect to listener");
@@ -509,7 +509,7 @@ static apr_status_t dummy_connection(ap_pod_t *pod)
         return rv;
     }
 
-    rv = apr_connect(sock, pod->sa);
+    rv = apr_socket_connect(sock, pod->sa);
     if (rv != APR_SUCCESS) {
         int log_level = APLOG_WARNING;
 
index 5bfe188c7c1113942dc50dd728fc0fcacc04c353..df8959304abc9bbab45fe3d9cd4a23c944892c28 100644 (file)
@@ -418,7 +418,8 @@ static int resolve_symlink(char *d, apr_finfo_t *lfi, int opts, apr_pool_t *p)
      * owner of the symlink, then get the info of the target.
      */
     if (!(lfi->valid & APR_FINFO_OWNER)) {
-        if ((res = apr_lstat(&fi, d, lfi->valid | APR_FINFO_OWNER, p))
+        if ((res = apr_stat(&fi, d, 
+                            lfi->valid | APR_FINFO_LINK | APR_FINFO_OWNER, p))
             != APR_SUCCESS) {
             return HTTP_FORBIDDEN;
         }
@@ -429,7 +430,7 @@ static int resolve_symlink(char *d, apr_finfo_t *lfi, int opts, apr_pool_t *p)
         return HTTP_FORBIDDEN;
     }
 
-    if (apr_compare_users(fi.user, lfi->user) != APR_SUCCESS) {
+    if (apr_uid_compare(fi.user, lfi->user) != APR_SUCCESS) {
         return HTTP_FORBIDDEN;
     }
 
@@ -806,7 +807,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
                     && ((entry_core->d_components < seg)
                      || (entry_core->d_is_fnmatch
                          ? (apr_fnmatch(entry_core->d, r->filename,
-                                        FNM_PATHNAME) != APR_SUCCESS)
+                                        APR_FNM_PATHNAME) != APR_SUCCESS)
                          : (strcmp(r->filename, entry_core->d) != 0)))) {
                     continue;
                 }
@@ -976,14 +977,16 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
                 continue;
             }
 
-            /* We choose apr_lstat here, rather that apr_stat, so that we
-             * capture this path object rather than its target.  We will
-             * replace the info with our target's info below.  We especially
-             * want the name of this 'link' object, not the name of its
-             * target, if we are fixing the filename case/resolving aliases.
+            /* We choose apr_stat with flag APR_FINFO_LINK here, rather that 
+             * plain apr_stat, so that we capture this path object rather than
+             * its target.  We will replace the info with our target's info 
+             * below.  We especially want the name of this 'link' object, not 
+             * the name of its target, if we are fixing the filename 
+             * case/resolving aliases.
              */
-            rv = apr_lstat(&thisinfo, r->filename,
-                           APR_FINFO_MIN | APR_FINFO_NAME, r->pool);
+            rv = apr_stat(&thisinfo, r->filename,
+                          APR_FINFO_MIN | APR_FINFO_NAME | APR_FINFO_LINK, 
+                          r->pool);
 
             if (APR_STATUS_IS_ENOENT(rv)) {
                 /* Nothing?  That could be nice.  But our directory
@@ -1273,7 +1276,7 @@ AP_DECLARE(int) ap_location_walk(request_rec *r)
             if (entry_core->r
                 ? ap_regexec(entry_core->r, r->uri, 0, NULL, 0)
                 : (entry_core->d_is_fnmatch
-                   ? apr_fnmatch(entry_core->d, cache->cached, FNM_PATHNAME)
+                   ? apr_fnmatch(entry_core->d, cache->cached, APR_FNM_PATHNAME)
                    : (strncmp(entry_core->d, cache->cached, len)
                       || (entry_core->d[len - 1] != '/'
                           && cache->cached[len] != '/'
@@ -1422,7 +1425,7 @@ AP_DECLARE(int) ap_file_walk(request_rec *r)
             if (entry_core->r
                 ? ap_regexec(entry_core->r, cache->cached , 0, NULL, 0)
                 : (entry_core->d_is_fnmatch
-                   ? apr_fnmatch(entry_core->d, cache->cached, FNM_PATHNAME)
+                   ? apr_fnmatch(entry_core->d, cache->cached, APR_FNM_PATHNAME)
                    : strcmp(entry_core->d, cache->cached))) {
                 continue;
             }
@@ -1715,10 +1718,10 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_dirent(const apr_finfo_t *dirent,
     if ((dirent->valid & APR_FINFO_MIN) != APR_FINFO_MIN) {
         /*
          * apr_dir_read isn't very complete on this platform, so
-         * we need another apr_lstat (or simply apr_stat if we allow
-         * all symlinks here.)  If this is an APR_LNK that resolves
-         * to an APR_DIR, then we will rerun everything anyways...
-         * this should be safe.
+         * we need another apr_stat (with or without APR_FINFO_LINK
+         * depending on whether we allow all symlinks here.)  If this 
+         * is an APR_LNK that resolves to an APR_DIR, then we will rerun 
+         * everything anyways... this should be safe.
          */
         apr_status_t rv;
         if (ap_allow_options(rnew) & OPT_SYM_LINKS) {
@@ -1729,8 +1732,9 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_dirent(const apr_finfo_t *dirent,
             }
         }
         else {
-            if (((rv = apr_lstat(&rnew->finfo, rnew->filename,
-                                 APR_FINFO_MIN, rnew->pool)) != APR_SUCCESS)
+            if (((rv = apr_stat(&rnew->finfo, rnew->filename,
+                                APR_FINFO_LINK | APR_FINFO_MIN, 
+                                rnew->pool)) != APR_SUCCESS)
                 && (rv != APR_INCOMPLETE)) {
                 rnew->finfo.filetype = 0;
             }
@@ -1834,8 +1838,9 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file,
             }
         }
         else {
-            if (((rv = apr_lstat(&rnew->finfo, rnew->filename,
-                                 APR_FINFO_MIN, rnew->pool)) != APR_SUCCESS)
+            if (((rv = apr_stat(&rnew->finfo, rnew->filename,
+                                APR_FINFO_LINK | APR_FINFO_MIN, 
+                                rnew->pool)) != APR_SUCCESS)
                 && (rv != APR_INCOMPLETE)) {
                 rnew->finfo.filetype = 0;
             }
index cf3ff2cadba65f68c0bbb3fd119d67b1a1551805..b83a8ca59eab0f92e645fd5c98eaab54ac10f06f 100644 (file)
@@ -928,7 +928,7 @@ AP_DECLARE(apr_status_t) ap_pcfg_openfile(ap_configfile_t **ret_cfg,
 
     if (finfo.filetype != APR_REG &&
 #if defined(WIN32) || defined(OS2) || defined(NETWARE)
-        strcasecmp(apr_filename_of_pathname(name), "nul") != 0) {
+        strcasecmp(apr_filepath_name_get(name), "nul") != 0) {
 #else
         strcmp(name, "/dev/null") != 0) {
 #endif /* WIN32 || OS2 */
@@ -1852,7 +1852,7 @@ AP_DECLARE(int) ap_is_rdirectory(apr_pool_t *p, const char *path)
 {
     apr_finfo_t finfo;
 
-    if (apr_lstat(&finfo, path, APR_FINFO_TYPE, p) != APR_SUCCESS)
+    if (apr_stat(&finfo, path, APR_FINFO_LINK | APR_FINFO_TYPE, p) != APR_SUCCESS)
         return 0;                /* in error condition, just return no */
 
     return (finfo.filetype == APR_DIR);
index dd7d9ce416823d118131c4b2a332d88588a422f0..1c05fedd7b132e1a732d392ceaee8a1c151315e6 100644 (file)
@@ -469,7 +469,7 @@ AP_DECLARE(int) ap_scan_script_header_err_core(request_rec *r, char *buffer,
        if ((*getsfunc) (w, MAX_STRING_LEN - 1, getsfunc_data) == 0) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, 0, r,
                          "Premature end of script headers: %s", 
-                          apr_filename_of_pathname(r->filename));
+                          apr_filepath_name_get(r->filename));
            return HTTP_INTERNAL_SERVER_ERROR;
        }
 
@@ -562,7 +562,7 @@ AP_DECLARE(int) ap_scan_script_header_err_core(request_rec *r, char *buffer,
 
            ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, 0, r,
                          "%s: %s", malformed, 
-                          apr_filename_of_pathname(r->filename));
+                          apr_filepath_name_get(r->filename));
            return HTTP_INTERNAL_SERVER_ERROR;
        }
 
index a29d8090407c55b6a4a0761b693f99afbc821008..18c75d55230274a51542d1d02d0ccb9628f60cf5 100644 (file)
    ** Version 2.0.36-dev
    **    Improvements to concurrent processing:
    **      - Enabled non-blocking connect()s.
-   **      - Prevent blocking calls to apr_recv() (thereby allowing AB to
+   **      - Prevent blocking calls to apr_socket_recv() (thereby allowing AB to
    **        manage its entire set of socket descriptors).
-   **      - Any error returned from apr_recv() that is not EAGAIN or EOF
+   **      - Any error returned from apr_socket_recv() that is not EAGAIN or EOF
    **        is now treated as fatal.
    **      Contributed by Aaron Bannert, April 24, 2002
    **
@@ -775,7 +775,7 @@ static void write_request(struct connection * c)
         }
         else
 #endif
-       e = apr_send(c->aprsock, request + c->rwrote, &l);
+       e = apr_socket_send(c->aprsock, request + c->rwrote, &l);
 
        /*
         * Bail early on the most common case
@@ -1257,7 +1257,7 @@ static void start_connect(struct connection * c)
     apr_pool_create(&c->ctx, cntxt);
 
     if ((rv = apr_socket_create(&c->aprsock, destsa->family,
-                               SOCK_STREAM, c->ctx)) != APR_SUCCESS) {
+                               SOCK_STREAM, 0, c->ctx)) != APR_SUCCESS) {
        apr_err("socket", rv);
     }
     if ((rv = apr_socket_opt_set(c->aprsock, APR_SO_NONBLOCK, 1))
@@ -1265,7 +1265,7 @@ static void start_connect(struct connection * c)
         apr_err("socket nonblock", rv);
     }
     c->start = apr_time_now();
-    if ((rv = apr_connect(c->aprsock, destsa)) != APR_SUCCESS) {
+    if ((rv = apr_socket_connect(c->aprsock, destsa)) != APR_SUCCESS) {
        if (APR_STATUS_IS_EINPROGRESS(rv)) {
             apr_pollfd_t new_pollfd;
            c->state = STATE_CONNECTING;
@@ -1287,7 +1287,7 @@ static void start_connect(struct connection * c)
            if (bad++ > 10) {
                fprintf(stderr,
                        "\nTest aborted after 10 failures\n\n");
-               apr_err("apr_connect()", rv);
+               apr_err("apr_socket_connect()", rv);
            }
            c->state = STATE_UNCONNECTED;
            start_connect(c);
@@ -1387,7 +1387,7 @@ static void read_connection(struct connection * c)
     }
     else {
 #endif
-    status = apr_recv(c->aprsock, buffer, &r);
+    status = apr_socket_recv(c->aprsock, buffer, &r);
     if (APR_STATUS_IS_EAGAIN(status))
        return;
     else if (r == 0 && APR_STATUS_IS_EOF(status)) {
@@ -1395,12 +1395,12 @@ static void read_connection(struct connection * c)
        close_connection(c);
        return;
     }
-    /* catch legitimate fatal apr_recv errors */
+    /* catch legitimate fatal apr_socket_recv errors */
     else if (status != APR_SUCCESS) {
         err_except++; /* XXX: is this the right error counter? */
         /* XXX: Should errors here be fatal, or should we allow a
          * certain number of them before completely failing? -aaron */
-        apr_err("apr_recv", status);
+        apr_err("apr_socket_recv", status);
     }
 #ifdef USE_SSL
     }
@@ -1758,7 +1758,7 @@ static void test(void)
            if (rv & APR_POLLOUT) {
                 if (c->state == STATE_CONNECTING) {
                     apr_pollfd_t remove_pollfd;
-                    rv = apr_connect(c->aprsock, destsa);
+                    rv = apr_socket_connect(c->aprsock, destsa);
                     remove_pollfd.desc_type = APR_POLL_SOCKET;
                     remove_pollfd.desc.s = c->aprsock;
                     apr_pollset_remove(readbits, &remove_pollfd);
@@ -1768,7 +1768,7 @@ static void test(void)
                         if (bad++ > 10) {
                             fprintf(stderr,
                                     "\nTest aborted after 10 failures\n\n");
-                            apr_err("apr_connect()", rv);
+                            apr_err("apr_socket_connect()", rv);
                         }
                         c->state = STATE_UNCONNECTED;
                         start_connect(c);
@@ -1822,14 +1822,14 @@ static void test(void)
 static void copyright(void)
 {
     if (!use_html) {
-       printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.130 $> apache-2.0");
+       printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.131 $> apache-2.0");
        printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
        printf("Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/\n");
        printf("\n");
     }
     else {
        printf("<p>\n");
-       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.130 $");
+       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.131 $");
        printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
        printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/<br>\n");
        printf("</p>\n<p>\n");