Giter Club home page Giter Club logo

routinghttpserver's People

Contributors

bcse avatar mattstevens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

routinghttpserver's Issues

EXC_BAD_ACCESS in -[RoutingConnection setHeadersForResponse:isError:]

I encountered a crash (just once) when the local device disappeared from the network in the middle of responding to a request:

    #0  0x00007fff909760dd in objc_msgSend ()
    #1  0x0000000108f42223 in -[RoutingConnection setHeadersForResponse:isError:] at /Users/ndouglas/Projects/DEVONthink-Sync-Plugin-2/Sync/External/RoutingHTTPServer/Source/RoutingConnection.m:91
    #2  0x0000000108f42758 in -[RoutingConnection preprocessResponse:] at /Users/ndouglas/Projects/DEVONthink-Sync-Plugin-2/Sync/External/RoutingHTTPServer/Source/RoutingConnection.m:110
    #3  0x0000000108e97039 in -[HTTPConnection sendResponseHeadersAndBody] at /Users/ndouglas/Projects/DEVONthink-Sync-Plugin-2/Sync/External/RoutingHTTPServer/External/CocoaHTTPServer/Core/HTTPConnection.m:1243
    #4  0x0000000108e95f87 in -[HTTPConnection replyToHTTPRequest] at /Users/ndouglas/Projects/DEVONthink-Sync-Plugin-2/Sync/External/RoutingHTTPServer/External/CocoaHTTPServer/Core/HTTPConnection.m:1025
    #5  0x0000000108e9b62a in -[HTTPConnection socket:didReadData:withTag:] at /Users/ndouglas/Projects/DEVONthink-Sync-Plugin-2/Sync/External/RoutingHTTPServer/External/CocoaHTTPServer/Core/HTTPConnection.m:2199
    #6  0x0000000108f3b553 in __37-[GCDAsyncSocket completeCurrentRead]_block_invoke at /Users/ndouglas/Projects/DEVONthink-Sync-Plugin-2/Sync/External/RoutingHTTPServer/External/CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m:5039
    #7  0x00000001008412bb in _dispatch_call_block_and_release ()
    #8  0x000000010083bd43 in _dispatch_client_callout ()
    #9  0x000000010083ffb3 in _dispatch_queue_drain ()
    #10 0x0000000100841fc0 in _dispatch_queue_invoke ()
    #11 0x000000010083ef5e in _dispatch_root_queue_drain ()
    #12 0x0000000100850cd0 in _dispatch_worker_thread3 ()
    #13 0x00007fff89d296cb in _pthread_wqthread ()
    #14 0x00007fff89d274a1 in start_wqthread ()
    Enqueued from GCDAsyncSocket (Thread 368)Queue : GCDAsyncSocket (serial)
    #0  0x000000010083dc92 in _dispatch_barrier_async_f_slow ()
    #1  0x0000000108f3b41e in -[GCDAsyncSocket completeCurrentRead] at /Users/ndouglas/Projects/DEVONthink-Sync-Plugin-2/Sync/External/RoutingHTTPServer/External/CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m:5037
    #2  0x0000000108f3a3bb in -[GCDAsyncSocket doReadData] at /Users/ndouglas/Projects/DEVONthink-Sync-Plugin-2/Sync/External/RoutingHTTPServer/External/CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m:4812
    #3  0x0000000108f38736 in -[GCDAsyncSocket maybeDequeueRead] at /Users/ndouglas/Projects/DEVONthink-Sync-Plugin-2/Sync/External/RoutingHTTPServer/External/CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m:4002
    #4  0x0000000108f37e49 in __79-[GCDAsyncSocket readDataToData:withTimeout:buffer:bufferOffset:maxLength:tag:]_block_invoke at /Users/ndouglas/Projects/DEVONthink-Sync-Plugin-2/Sync/External/RoutingHTTPServer/External/CocoaHTTPServer/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m:3907
    #5  0x00000001008412bb in _dispatch_call_block_and_release ()
    #6  0x000000010083bd43 in _dispatch_client_callout ()
    #7  0x000000010083ffb3 in _dispatch_queue_drain ()
    #8  0x0000000100841fc0 in _dispatch_queue_invoke ()
    #9  0x000000010083ef5e in _dispatch_root_queue_drain ()
    #10 0x0000000100850cd0 in _dispatch_worker_thread3 ()
    #11 0x00007fff89d296cb in _pthread_wqthread ()
    #12 0x00007fff89d274a1 in start_wqthread ()

Relevant method:

    - (void)setHeadersForResponse:(HTTPMessage *)response isError:(BOOL)isError {
        [http.defaultHeaders enumerateKeysAndObjectsUsingBlock:^(id field, id value, BOOL *stop) {
            [response setHeaderField:field value:value];
        }];
        ....
    }

Limited messing around in the debugger:

    (lldb) po http.defaultHeaders
    error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=EXC_I386_GPFLT).
    The process has been returned to the state before expression evaluation.
    (lldb) po http
    0x0000600000194500

It's entirely possible that it's something that I'm doing, i.e. shutting off the server too abruptly or something, so feel free to assume I'm a dangerous idiot :-).

I can show you any relevant code you'd like to see.

Can't defer response from handleMethod:withPath:block:

I'd like handleMethod:withPath:block: to be able to defer response until after some other asynchronous action has completed.

For example:
handleMethod is called, I pull data from Core Data asynchronously, and finally respond to the HTTP request with respondWithString: (or other).

The problem is that the connection is immediately closed after the end of the block call in handleMethod:withPath:block:. I kind of just assumed it would be possible to do what I was thinking based on the method names and the use of blocks. Is it possible to add an asynchronous group of responses that hold the connection open until I mark done?

Could I change localhost by another string?

Hello,

Could I change the name of the default localhost by http://example.com/

For example:

Instead of

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://localhost:1234"]];

I want to do

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http:///example.com/"]];

Thanks in advance.

Have you used this Server to implement DLNA?

Recently I'm working on a project to server music from iPhone's library to DLNA supported device. Doing some search I came to your project. I'm wondering if you have implemented DLNA server with this project?

Sorry for my poor English.

File upload

RoutingHTTPServer seems quite promising and it has already helped me alot. Thanks for sharing it.

Question: How do i upload file using RoutingHTTPServer. can you please include an example for it.

It does not work under swift

After i run a simple example code using swift. I can not connect the embedded server. Does it work well for swift?

Compilation error with pods 1.1.1

In RoutingConnection, the line :

@Property (atomic, weak) RoutingHTTPServer *http;

produces this error :

"cannot synthesize weak property because the current deployment target does not support weak reference"

Any idea how to fix this please ? I've searched on Google but I could not find how to solve this issue.

Running on 10.6 fails: [NSPlaceholderMutableString initWithString:]: nil argument

When setting Deployment Target to 10.6 and running resulting RoutingHttpServer example on a 10.6 machine, the following error appears in the system.log:

RoutingHTTPServer[378]: *** -[NSPlaceholderMutableString initWithString:]: nil argument

It looks like it's coming from around the:

path = [regex stringByReplacingMatchesInString:

section of RoutingHttpServer:routeWithPath. That API doesn't exist in 10.6 I think.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.