Giter Site home page Giter Site logo

fsnetworking's People

Contributors

adamalix avatar gwk avatar itsbonczek avatar wardbekker 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  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

fsnetworking's Issues

cancel specific request

Hello
i am trying to add many upload requests to a "queue".
in your example you do:
self.connection = [self makeConnection];
[self.connection start];

i have 2 questions:
1st -> how can i upload many requests to a single queue?
2nd -> how can i cancel a specific one from the queue?

thanks a lot

BUG Running FSNetworking in background threads

I don't know if its supported, but it seems to work. Mostly.

In FSNConnection, there is the mutableset of current connections.

mutableConnections

It is a NSMutableSet and is a global, but accessed by eac h object with no @synchronize() {} block.

So the code need to change in two places -

In cleanup

NSMutableSet *requests = [self.class mutableConnections];
@synchronized(requests) {
    [requests removeObject:self];
}

And in start
NSMutableSet *connections = [self.class mutableConnections];
@synchronized(connections) {
[connections addObject:self];
}

I got a crash (as would make sense) when using about 3 of these on threads on 10.8.4 Mac, with XCode 5. With Zombies and what not on, it pointed right at the cleanup line.

--Tom

[self.connection cancel] cancel other connections?

Hi I experience some problems with [self.connection cancel] in the dealloc method. I have a feeling it sometimes also cancel other ongoing request in the queue. Is this possible ? I have experimented both with and without FSN_QUEUED_CONNECTIONS.

- (void)dealloc {

    NSAssert(!self.connection, @"non-nil connection: %@", self.connection);

#if TARGET_OS_IPHONE
    // if this task was set to run in background then the expiration handler should be retaining self
    NSAssert1(self.taskIdentifier == UIBackgroundTaskInvalid,
              @"deallocated request has background task identifier: %@", self);
#endif


    [self clearBlocks]; // not cleanup; assert no taskIdentifer above instead

    // just to be safe in production
    FSNVerbose(@"%p: dealloc", self);

    [self.connection cancel];
}

FSNData and Straight C Code

I am adding a few things to FSNData, and I would like to know the why straight C code was used for NSString *stringForMimeType(MimeType type); over a class level method. Is it a preferred style, or some other reason?

Post sub-array params

Hi guys,
i went back in this problem, basically we can't post NSArray as params, so, i thought to create an NSMutableDictionary variable, and dynamically putting in it all my params, creating subarray, like this 'params[object][][field1]' and so on. But my problem is that him is overwriting always the same value, not creating subarray. 👎
i tried to create params like this: [NSString stringWithFormat:@"supply[%i][description]", i], but is really ugly.

any better ideas to solve this problem? any workaround much better?
thanks guys.

URL is Invalid

I am trying to integrate FSNetworking into my application. When I debug [FSNConnection start], I see the URL is invalid and I get the error "message sent to deallocated instance." When printed, I get:
(lldb)po self.url (NSURL *) $4 = 0x07e81150 [no Objective-C description available]. The NSAssert(self.url, @"nil url") passes, I am guessing this is a dangling pointer.

My project is compiled with ARC enabled, and I set -fno-objc-arc as suggested in the readme file.

Please add semantic version tags

I’ve recently added FSNetworking to the CocoaPods package manager repo.

CocoaPods is a tool for managing dependencies for OS X and iOS Xcode projects and provides a central repository for iOS/OS X libraries. This makes adding libraries to a project and updating them extremely easy and it will help users to resolve dependencies of the libraries they use.

However, FSNetworking doesn't have any version tags. I’ve added the current HEAD as version 0.0.1, but a version tag will make dependency resolution much easier.

Semantic version tags (instead of plain commit hashes/revisions) allow for resolution of cross-dependencies.

In case you didn’t know this yet; you can tag the current HEAD as, for instance, version 1.0.0, like so:

$ git tag -a 1.0.0 -m "Tag release 1.0.0"
$ git push --tags

Race condition in FSNConnection

failWithError: is not designed to be called more than once, but in our case it is sometimes called twice: when the internet connectivity dies, and when UIApplication decides to run 'fireExpirationHandler'.

Presumably, 'endBackgroundTask' should prevent this from happening, but the first time failWithError: is called, 'complete' is enqueued on the run loop, and may be called only after the second call to failWithError:. Hence the race condition.

arrayFromJSONWithError for NSData category

Along with this method:

// convenience method to ensure that top-level json object is a dictionary
- (id)dictionaryFromJSONWithError:(NSError **)error; // error pointer must not be nil

it would be really great if you provide arrayFromJSONWithError that internally calls this one and returns NSArray of NSDictionary instances from JSON, that would be good. I guess you also have such a need in 4sq API. Am I missing an obvious workaround?

Thanks.

Please pull in additional refactors in the outstanding pull request.

There is stuff accumulating in my fork that i would like to see upstream; most recently I did a small refactor of adam's isAcceptableValue changes and he asked me to open an issue. It is all very straightforward stuff.

My change set does not fix the missing NSArray urlEncodedString implementation, but it does add one for NSNumber that replaces the old inlined conditional logic.

Thanks! -g

DELETE method

My backend has a DELETE endpoint. What needs to be changed for this library to support DELETE requests?

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.