Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - bludra84

#1
newLISP in the real world /
September 29, 2009, 09:47:23 AM
Great, thanks for the tip.
#2
newLISP in the real world /
September 29, 2009, 09:43:02 AM
Ahh, thanks for the help! So is this a bug that will be fixed or was I missinterpreting how to use ends-with?
#3
newLISP in the real world /
September 29, 2009, 08:34:40 AM
No, I am just using IPv4.
#4
newLISP in the real world /
September 28, 2009, 10:27:09 PM
Oh, and this is in linux version 10.1.5. Thank you in advance.
#5
newLISP in the real world / Odd crash
September 28, 2009, 10:22:47 PM
I have been messing with some code to respond to simple HTTP requests and have run into a weird bug. The following code results in a crash with this error:
 
Quote*** glibc detected *** /usr/bin/newlisp: double free or corruption (fasttop): 0x


#!/usr/bin/newlisp

(constant 'max-bytes 1024)

(define (error num)
    (format "Error: %d" num))

(define (process-request request)
    (set 'request (parse request " "))
    (case (first request)
        ("GET"  (get-request (request 1)))
        ("HEAD" (create-head (request 1)))
        (true   (error 501))))

(define (get-request item)
    (set 'item (replace "../" item ""))
    (if (ends-with item {.css|.html} 1) (send-file (1 item))
        (string "file not allowedn")))

(define (send-file filename)
    (if (file? filename) (read-file filename)
        (error 404)))

(define (create-head item)
    (string "head"))


;
; PROGRAM START
;
(if (not (setf listen (net-listen 8080)))
    (print (net-error)))

(while (not (net-error))
    (setf connection (net-accept listen))
    (net-receive connection message max-bytes)
    (net-send connection (process-request message))
    (close connection))


;(while true
;    (print (process-request "GET /test.html")))

(exit)


I test this by running: echo "GET /test.html" | nc localhost 8080

The while loop commented out at the bottom will run fine for me. So all the code should be ok except for the loop where I manage the connection. Have I done something weird there, or is this a bug in newlisp?
#6
newLISP and the O.S. /
August 27, 2009, 06:20:32 PM
I'm using 10.1.1



Is the development version stable enough for normal use?
#7
newLISP and the O.S. / Compiling on Debian Armel
August 27, 2009, 08:22:44 AM
This works perfect after running a ./configure-alt and then removing the "-m32" option from the compiler and linker flags. Dunno how useful that is to anyone. I'm running newlisp on a Linksys NSLU2.