Add comments.

This commit is contained in:
Miao Jiang 2013-02-19 17:31:59 +08:00
parent 2c414d1469
commit d25438bdf0

View file

@ -39,13 +39,17 @@ Curl.user_options =
RAW: 'RAW' RAW: 'RAW'
DEBUG: 'DEBUG' DEBUG: 'DEBUG'
# on 'data' must be returns the chunk length
Curl::on = (event, callback) -> Curl::on = (event, callback) ->
switch event switch event
when 'data' when 'data'
# (Buffer chunk) ->
@on_write = callback @on_write = callback
when 'error' when 'error'
# (Error error) ->
@on_error = callback @on_error = callback
when 'end' when 'end'
# () ->
@on_end = callback @on_end = callback
else else
throw new Error("invalid event type #{event}") throw new Error("invalid event type #{event}")