[go-nuts] Re: How to abort the http ResponseWriter

2017-04-02 Thread Song Liu
Is there any other official way to cancel a ResponseWriter ? Many thanks. On Saturday, April 1, 2017 at 8:12:55 PM UTC+8, Song Liu wrote: > > > I am implementing a file server, so http.ServerFile used to write back the > file content to remote client: > > >

[go-nuts] Re: How to abort the http ResponseWriter

2017-04-01 Thread Song Liu
Finally I added a Close function into the ResponseWriter, sadly. On Saturday, April 1, 2017 at 8:12:55 PM UTC+8, Song Liu wrote: > > > I am implementing a file server, so http.ServerFile used to write back the > file content to remote client: > > > func downloadFile(w h

[go-nuts] How to abort the http ResponseWriter

2017-04-01 Thread Song Liu
I am implementing a file server, so http.ServerFile used to write back the file content to remote client: func downloadFile(w http.ResponseWriter, r *http.Request, p httprouter.Params) { ... http.ServeFile(w, r, filePath) } But sometimes the server want to abort the downloading, so

[go-nuts] Re: How to control the symbol visibility of shared lib built from Go

2017-03-30 Thread Song Liu
inking of this kind of use, or did you have soemthing else in > mind? > > --dave > [1. http://multicians.org/mgb.html] > > On Monday, March 20, 2017 at 7:51:56 AM UTC-4, Song Liu wrote: >> >> But it seems that all the symbols from this library is "DEFAULT&q

Re: [go-nuts] How to return a Go struct to C

2017-03-20 Thread Song Liu
issue? many thanks. On Monday, March 20, 2017 at 9:43:38 PM UTC+8, Steven Hartland wrote: > > The following may help: > http://feisky.xyz/2016/04/19/cgo-in-go-1-6/ > > On 20/03/2017 13:25, Song Liu wrote: > > Hi, > > I have a shared lib as bellow: > > /* > >

Re: [go-nuts] How to control the symbol visibility of shared lib built from Go

2017-03-20 Thread Song Liu
performance. On Tuesday, March 21, 2017 at 7:09:06 AM UTC+8, Ian Lance Taylor wrote: > > On Mon, Mar 20, 2017 at 4:51 AM, Song Liu > > wrote: > > > > I am going to write a shared library using the Go, you know that the Go > > runtime and used libraries are comp

[go-nuts] How to return a Go struct to C

2017-03-20 Thread Song Liu
Hi, I have a shared lib as bellow: /* #include struct Media { char*Name; char*Path; uint64_t Size; }; */ import "C" //export GetMediaFromDB func GetMediaFromDB(filename *C.char) *C.struct_Media { c_struct_media := &C.struct_Media{} return c_struct_med

[go-nuts] How to control the symbol visibility of shared lib built from Go

2017-03-20 Thread Song Liu
Hi, I am going to write a shared library using the Go, you know that the Go runtime and used libraries are compiled into the library together. But it seems that all the symbols from this library is "DEFAULT", is there a way to use the "HIDDEN" symbol visibility by default, but "DEFAULT" only f

[go-nuts] No timeout mechanism with the Request.Body.Read

2016-09-27 Thread Song Liu
http.Server.ReadTimeout is per the whole Read quest, but I need the timeout for a single Request.Body.Read. What need to do ? thanks. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails fr