Changeset a62ceaf in mainline for uspace/lib/http/src/http.c


Ignore:
Timestamp:
2016-02-29T19:19:19Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
129b92c6
Parents:
5147ff1
Message:

Need better interfaces for handling internet host and host:port specifications.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/http/src/http.c

    r5147ff1 ra62ceaf  
    4040#include <macros.h>
    4141
    42 #include <inet/dnsr.h>
     42#include <inet/endpoint.h>
     43#include <inet/host.h>
    4344#include <inet/tcp.h>
    4445
     
    8889                return EBUSY;
    8990       
    90         /* Interpret as address */
    91         int rc = inet_addr_parse(http->host, &http->addr);
    92        
    93         if (rc != EOK) {
    94                 /* Interpret as a host name */
    95                 dnsr_hostinfo_t *hinfo = NULL;
    96                 rc = dnsr_name2host(http->host, &hinfo, ip_any);
    97                
    98                 if (rc != EOK)
    99                         return rc;
    100                
    101                 http->addr = hinfo->addr;
    102                 dnsr_hostinfo_destroy(hinfo);
    103         }
     91        int rc = inet_host_plookup_one(http->host, ip_any, &http->addr, NULL,
     92            NULL);
     93        if (rc != EOK)
     94                return rc;
    10495       
    10596        inet_ep2_t epp;
Note: See TracChangeset for help on using the changeset viewer.