After many days of fighting Sandvox and its underlying Connection Kit framework, I’ve managed to upload my website. All my uploading problems stem from Connection Kit’s poor implementation of SFTP. What basically happened is that the SFTP implementation was bolted onto the libssh2 library. Like most UNIX libraries, libssh2 uses UNIX socket calls such as recv, write and writev. Connection Kit is based around Apple’s stream calls with queued writes and basically non-blocking reads. So Connection Kit tries to merge the 2, but does a poor job. Apple’s stream calls actually give access to the UNIX sockets, so write, writev, and recv could have been used. I removed the hacked up write calls so that write was used, but when I tried to use recv, things got strange. I ended up changing the buffer size to 16K (from 32K) prompted by a comment in the code:
#warning this byte range was really out of hand for Terrence
The reason the byte range is a problem, as far as I can tell is that at some point down in the libssh2 library, it calls Read which is mapped to a stream call and doesn’t properly handle blocking calls.
So, what have I learned from this fiasco:
- Sandvox produced a website that I like
- Demos of programs should be time based and not feature limited; if this was the case, I wouldn’t have spent $79 and wasted days on this program
- Open source sucks; there is a ton of open source code out there developed by anyone that wants to put out code. The quality of the code is sometimes suspect; while some parts may be good, there may be problems that are hard to solve. I’ve been in the same boat before using open source code without fully understanding how it worked and it has bit me a few times.
- Open source is great; since the underlying framework was open source, I was able to examine it, find the flaws, and patch it (note I didn’t say fix as the SFTP stuff needs to be rewritten or at least thoroughly reviewed)
- My blogging isn’t completely useless; I did get a response from one of the authors of Sandvox
- I’m stubborn (OK, I already knew that). Most people would have given up and asked for their money back. I still should ask for my money back as I probably spent 10-12 hours on this at say $75 per hour (cheap engineer), that puts my time investment into solving their problem at well over $750.
- The Apple Design Awards are only about pretty pictures; a friend of mine told me that someone at Apple kept raving about Coda’s leaf icon. I like Coda and think it is a decent app, but hey, it’s a website editor. In fact, several of the ADA winners were web design apps. Maybe if I want to win, I’ll have to do a web design app. Maybe I’m just bitter about ReceiptWallet not winning. (Hey, Apple, send me my scanner back!)
- People don’t care about security or don’t have SFTP access to upload their website. Having SFTP pretty broken for one of 4 transport mechanisms seems kind of odd. My SSH server is sitting on a gigabit ethernet link to my machine and is a standard OpenSSH install, so it couldn’t just be my server.
There’s probably more that I’ve learned, but I can’t think of it now.
So, am I done with this? No, I have to redo my site because there are several bugs in Sandvox that are causing me problems. First off, the navigation bar is a different height in the main page and all sub pages; I can’t reproduce this on a new site, so something got hosed when I built it. Also, I can’t select a picture and create a link once I’ve entered my text. In addition, the text editor only sometimes supports undo. If I drag in pictures, things get kind of wacky.
I really need to stop trying to do my own website and hire someone to do it. It would save me a whole lot of time and frustration.